12.7.2. Configure a Log Category in the Management Console
Log Categories define what log messages to capture and which log handlers to send them to.
Important
Currently Log Categories can only be fully configured in the server configuration file. The final release will support full configuration using the management console and command line administration tools.
To add a new Log Handler in the server configuration file:
Halt the server
Stop the JBoss EAP 6 server if it is already running.Open the configuration file in a text editor.
Depending on whether you run JBoss EAP 6 as a managed domain or standalone server, the default configuration file location isEAP_HOME/domain/configuration/domain.xml
orEAP_HOME/standalone/configuration/standalone.xml
.Find the Logging Subsystem node
Locate the Logging Subsystem configuration node. It will look like this:<subsystem xmlns="urn:jboss:domain:logging:1.1"> </subsystem>
The Logging Subsystem configuration will already contain many items such as Log Handlers and Categories.Add a new logger node
Add a new<logger>
node as a child of the Logging Subsystem node. It must have an attribute calledcategory
which is the class or package name which this logger will receive messages from.<logger category="com.acme.accounts.receivables"> </logger>
Optionally theuse-parent-handlers
attribute can also be added. This attribute can be set totrue
orfalse
. When set totrue
all messages received by this log category are also processed by the handlers of the root logger. If not specified, this attribute defaults totrue
.Specify log level
Add a<level>
element with an attribute called name. The value of name must be the log level that this category will apply to.<logger category="com.acme.accounts.receivables"> <level name="DEBUG"/> </logger>
Optional: Specify log handlers
Add a<handlers>
element containing a<handler>
element for each log handler you wish to use to process the log messages from this category.If no handlers are specified then the log message will not be processed any further unless use-parent-handler is set to true in which case the handlers of the root-logger are used.<logger category="com.acme.accounts.receivables"> <level name="DEBUG"/> <handlers> <handler name="ACCOUNTS-DEBUG-FILE"/> </handlers> </logger>
- Restart the JBoss EAP 6 server.