Search

5.5.2. Sample XML Configuration for a Log Category

download PDF
The following procedure demonstrates a sample configuration for a log category.

Procedure 5.2. Configure a Log Category

  1. Define the Category

    Use the category property to specify the log category from which log messages will be captured.
    The use-parent-handlers is set to "true" by default. When set to "true", this category will use the log handlers of the root logger in addition to any other assigned handlers.
    <subsystem xmlns="urn:jboss:domain:logging:1.2">
       <logger category="com.company.accounts.rec" use-parent-handlers="true">
    
  2. Set the level property

    Use the level property to set the maximum level of log message that the log category records.
    <subsystem xmlns="urn:jboss:domain:logging:1.2">
       <logger category="com.company.accounts.rec" use-parent-handlers="true">
          <level name="WARN"/>
    
  3. List handlers

    handlers is a list of log handlers.
    <subsystem xmlns="urn:jboss:domain:logging:1.2">
       <logger category="com.company.accounts.rec" use-parent-handlers="true">
          <level name="WARN"/>
          <handlers>
             <handler name="accounts-rec"/>
          </handlers>
       </logger>
    </subsystem>
    
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.