Re: Programmatically setting log4j2 log level

2013-05-18 Thread Ralph Goers
Yes, that is correct. The getRootLogger method is not included in the Configuration interface. I created a unit test to verify the code worked and I should have pasted the code from the test. Ralph On May 18, 2013, at 7:26 PM, Eric Scheie wrote: > I should add that I didn't find the getRootL

Re: Programmatically setting log4j2 log level

2013-05-18 Thread Eric Scheie
I should add that I didn't find the getRootLogger method in the API. This is the actual code I used. LoggerContext ctx = (LoggerContext) LogManager.getContext(false); Configuration config = ctx.getConfiguration(); LoggerConfig loggerConfig = config.getLoggerConfig(LogManager. ROOT_LOGGER_

Re: Programmatically setting log4j2 log level

2013-05-18 Thread Nick Williams
I agree, Scott. On May 18, 2013, at 11:11 AM, Scott Deboy wrote: > From looking at this, seems like config.getRootLoggerConfig() would be a > better name. > On May 17, 2013 10:40 PM, "Ralph Goers" wrote: > >> No, the X Logger does not inherit its level from the root Logger. It >> inherits its l

Re: Programmatically setting log4j2 log level

2013-05-18 Thread Scott Deboy
>From looking at this, seems like config.getRootLoggerConfig() would be a better name. On May 17, 2013 10:40 PM, "Ralph Goers" wrote: > No, the X Logger does not inherit its level from the root Logger. It > inherits its level from the root LoggerConfig. See the picture at > http://logging.apache

Re: Programmatically setting log4j2 log level

2013-05-18 Thread Eric Scheie
Thanks Ralph! That was the code snippet I was looking for. Works great! Best, -Eric On Fri, May 17, 2013 at 10:39 PM, Ralph Goers wrote: > No, the X Logger does not inherit its level from the root Logger. It > inherits its level from the root LoggerConfig. See the picture at > http://logging