I have jboss 7.1.1 with the following definition:
<subsystem xmlns="urn:jboss:domain:logging:1.1">
<console-handler name="CONSOLE">
<level name="INFO"/>
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
</console-handler>
<periodic-rotating-file-handler name="FILE">
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="server.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
<size-rotating-file-handler name="ACEII">
<level name="DEBUG"/>
<formatter>
<pattern-formatter pattern="%z{utc}%d{dd/MM/yyyy HH:mm:ss,SSS} %-5p [%c] %s%E%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="ACEII.log"/>
<rotate-size value="100K"/>
<max-backup-index value="10"/>
<append value="false"/>
</size-rotating-file-handler>
<logger category="ace2">
<level name="DEBUG"/>
<handlers>
<handler name="ACEII"/>
</handlers>
</logger>
<logger category="com.arjuna">
<level name="WARN"/>
</logger>
<logger category="org.apache.tomcat.util.modeler">
<level name="WARN"/>
</logger>
<logger category="sun.rmi">
<level name="WARN"/>
</logger>
<logger category="jacorb">
<level name="WARN"/>
</logger>
<logger category="jacorb.config">
<level name="ERROR"/>
</logger>
<root-logger>
<level name="INFO"/>
<handlers>
<handler name="CONSOLE"/>
<handler name="FILE"/>
</handlers>
</root-logger>
</subsystem>
as u can see I have one handler that write to the server.log and the other to ACE2.log. problem is that the ACE2 logs are also written to the server.log, what am i doing wrong ?
I found the answer, just add the use-parent-handlers="false" to your logger:
<logger category="ace2" use-parent-handlers="false">
<level name="DEBUG"/>
<handlers>
<handler name="ACEII"/>
</handlers>
</logger>
The FILE
handler which writes to server.log
is listed in the root logger and thus will receive the messages from the ace2
logger as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With