logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nayden Gochev <goc...@gmail.com>
Subject Adding a logger with custom appender pragmatically, without using the ROOT appends for this logger, is this possible?
Date Mon, 21 Jul 2014 14:20:29 GMT
In short:
I am trying to add a custom appender + logger for some package for example
However the root appenders (appender refs) are always added as well
automatically.. so even if I have a root appender(s) with level INFO
defined in the log4j2.xml,
ones I add a logger with level DEBUG.. with a new appender (only 1) .. the
2 root appenders that I have defined in the XML automatically starts
receiving this DEBUG messages as well.

Is it possible somehow to REMOVE this ROOT appends.. from my newly created
logger ?
newLoggerConfig.getAppenderRefs().clear(); doesn't work of course :)

Thanks for the help,
much appreciated.

View raw message