How to log the same category to different handlers?

Solution Unverified - Updated -

Issue

  • We are logging application logs to both the files (using logger in jboss xml file). However,since our application log category uses the level "DEBUG", it fills up the files very fast. So we would like to keep "DEBUG" for the one file and log "INFO" to the another file.

  • Tried the following, but it doesn't work, since apparently, I can't define the same category twice:

<logger category="org.sample" use-parent-handlers="false">
   <level name="INFO"/>
   <handlers>
     <handler name="Sample_Appender1"/>
   </handlers>
</logger>

<logger category="org.sample" use-parent-handlers="false">
  <level name="DEBUG"/>
  <handlers>
    <handler name="Sample_Appender2"/>
  </handlers>
</logger>

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.