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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content