if you set -DAsyncLoggerContextSelector ,all the asyncRoot node should be 
changed to Root, because needn't.
the difference is  set DAsyncLoggerContextSelector make all the logger 
async,however. asyncRoot  only make async inclued in  the node.




------------------ ???????? ------------------
??????: "Strong Su";<[email protected]>;
????????: 2015??10??19??(??????) ????5:57
??????: "Log4J Users List"<[email protected]>; 

????: Difference between <asyncRoot> and -DAsyncLoggerContextSelector



Hello everyone,

I'm not pretty sure about the difference <asyncRoot>
and -DAsyncLoggerContextSelector.
Here is a small slice example of log4j2.xml:

<Loggers>
    <logger name="Class_A" level="info" additivity="false"/>
    <root level="info/>
</Loggers>

When I set -DAsyncLoggerContextSelector, and both Class_A's logs and other
logs(like Class_B) should be async because the JAVA_OPTS makes all loggers
async..
But if I do not set -DAsyncLoggerContextSelector and change root to
asyncroot.
Should logs from Class_A be async or sync?
And what will happen if I remove additivity="false"?

Thank you.
Best Regards,
Dylan Su

Reply via email to