use-parent-handlers="false" does not work
kaspatoo Mar 14, 2018 7:49 AMHi,
I hope I am doing wrong and can say what it is.
I have a problem with logging, that although i defined use-parent-handers="false" every log is also printed in the root logger (=console).
This ist form my standalone.xml:
edit2: web-forum crashed my codes, pasted again:
<profile> <subsystem xmlns="urn:jboss:domain:logging:3.0"> <console-handler name="CONSOLE"> <level name="TRACE"/> <formatter> <named-formatter name="COLOR-PATTERN"/> </formatter> </console-handler> <periodic-rotating-file-handler name="FILE" autoflush="true"> <formatter> <named-formatter name="PATTERN"/> </formatter> <file relative-to="jboss.server.log.dir" path="server.log"/> <suffix value=".yyyy-MM-dd"/> <append value="true"/> </periodic-rotating-file-handler> <periodic-rotating-file-handler name="TEST" autoflush="true"> <formatter> <named-formatter name="PATTERN"/> </formatter> <file relative-to="jboss.server.log.dir" path="test.log"/> <suffix value=".yyyy-MM-dd"/> <append value="true"/> </periodic-rotating-file-handler> <logger category="org.jboss.modules" use-parent-handlers="false"> <level name="TRACE"/> <handlers> <handler name="TEST"/> </handlers> </logger> <root-logger> <level name="INFO"/> <handlers> <handler name="CONSOLE"/> <handler name="FILE"/> </handlers> </root-logger> <formatter name="PATTERN"> <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/> </formatter> <formatter name="COLOR-PATTERN"> <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/> </formatter> </subsystem>
After adding this logger:
<logger category="org.jboss.modules" use-parent-handlers="false"> <level name="TRACE"/> <handlers> <handler name="TEST"/> </handlers> </logger>
every trace is also printed to console.
After removing this logger again, console prints as expected.
As far as I understand this would be normal behaviour if I did not defined use-parent-handlers="false" but I did and I do not understand why it is not working.
edit:
I also do not understand why root-logger is logging it at all, because its level is set to INFO and log outputs in console are of TRACE. This should not happen I think.
edit3: nvm, since use-parent-handlers="false" does not work, its pushing then up to root-logger, while log-level TRACE is used and because it was defined previuosly, the level of the root-logger in this case is ignored.
If you need further information, feel free to ask.
Thanks in advance.