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:
  1. Halt the server

    Stop the JBoss EAP 6 server if it is already running.
  2. 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 is EAP_HOME/domain/configuration/domain.xml or EAP_HOME/standalone/configuration/standalone.xml.
  3. 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.
  4. Add a new logger node

    Add a new <logger> node as a child of the Logging Subsystem node. It must have an attribute called category which is the class or package name which this logger will receive messages from.
    <logger category="com.acme.accounts.receivables">
    
    </logger>
    
    Optionally the use-parent-handlers attribute can also be added. This attribute can be set to true or false. When set to true all messages received by this log category are also processed by the handlers of the root logger. If not specified, this attribute defaults to true.
  5. 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>
    
  6. 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>
    
  7. Restart the JBoss EAP 6 server.