Ultranium
Ultranium

Reputation: 372

Modifying Wildfly logging configuration on application deploy

I'm using Wildfly 9 and I want to have a separate log file for my application. I also want to use Wildfly Administation Console's Log viewer to view this log file. It also would be great if each node's apllication logs will be available from Wildfly domain controller, like it's realized for server.log.

It's easy to make such setup using Admin Console (create new log handlers, categories and so on), but it would be great if I could avoid making this configuration each time I'm deploying my application to a new server.

So, is it possible to distribute these AS configuration changes along with my application and apply them on-the-fly during deployment?

I'm aware of Wildfly per-deployment logging, but it looks like log files, defined in custom log4j config file won't be available in Wildfly Admin Console.

Upvotes: 2

Views: 4269

Answers (1)

James R. Perkins
James R. Perkins

Reputation: 17780

Have a look at logging profiles. Using a logging profile you can assign different logging configurations to different deployments. It also allows you to use the log view, assuming you use the jboss.server.log.dir relative path, and make changes at runtime.

As far as provisioning a new server. There's nothing you can really do at deployment time, but you could use CLI scripts to provision it before you deploy. Almost all the logging configuration can be changed at runtime without a reload or restart.

Upvotes: 3

Related Questions