-
1. Re: Logs are written twice in Wildfly 8
jaysensharma Dec 29, 2015 11:12 AM (in response to arkadyz)Did you try setting [
use-parent-handlers="false"
] to see how it goes:<logger category="a.b.c.d" use-parent-handlers="false"> <!-- Notice --> <level name="DEBUG"/> <handlers> <handler name="LogFile"/> </handlers> </logger>
The use-parent-handlers attribute is a boolean attribute to determine whether or not parent loggers should also process the log message.
https://docs.jboss.org/author/display/WFLY8/Loggers#Loggers-useparenthandlers
Regards
Jay SenSharma
-
2. Re: Logs are written twice in Wildfly 8
arkadyz Dec 30, 2015 8:30 AM (in response to jaysensharma)Hello Jay,
Thanks for quick reply. This is a really good idea. But I have a concern here. Suppose we have following situation:
<logger category="a.b.c.d">
<level name="DEBUG"/>
<handlers>
<handler name="LogFile"/>
</handlers>
</logger>
<logger category="a.b.c">
<level name="DEBUG"/>
<handlers>
<handler name="LogFile"/>
<handler name="LogFile1"/>
</handlers>
</logger>
If the message is from category "a.b.c.d" we would like it is treated also by LogFile1, we just not want this message is treated twice by LogFile. If I am not mistaken, it is supported by log4j. Is there a way to do it in Wildfly logging framework ?
Thanks,
Arkady