Language and Page Formatting Options
11.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.
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 serverStop the JBoss Enterprise Application Platform 6 server if it is already running.
Open the configuration file in a text editor.Depending on whether you run the Enterprise Application Platform as a managed domain or standalone server, the default configuration file location is
Find the Logging Subsystem nodeLocate 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 nodeAdd a new
<logger>node as a child of the Logging Subsystem node. It must have an attribute called
categorywhich is the class or package name which this logger will receive messages from.
<logger category="com.acme.accounts.receivables"> </logger>Optionally the
use-parent-handlersattribute can also be added. This attribute can be set to
false. When set to
trueall messages received by this log category are also processed by the handlers of the root logger. If not specified, this attribute defaults to
Specify log levelAdd 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 handlersAdd 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 Enterprise Application Platform 6 server.