logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [Feature Request] Setting Log Level at Runtime?
Date Mon, 27 Jun 2016 23:26:35 GMT
On Mon, Jun 27, 2016 at 3:56 PM, Ole Ersoy <ole.ersoy@gmail.com> wrote:

> Any chance that the simplicity level for this could could match SLF4J?  I
> think that there is a setLevel method on Logger, but it's protected or
> private ...
>
> SLF4J Example:
>
> http://stackoverflow.com/questions/38064066/configuration-a-logger-programmatically-with-log4j-2



   1. // org.apache.logging.log4j.core.config.Configurator;
   2.
   3. Configurator.setLevel("com.example.Foo", Level.DEBUG);
   4.
   5. // You can also set the root logger:
   6. Configurator.setRootLevel(Level.DEBUG);


I also replied on SO.

Gary


>
>
> Cheers,
> Ole
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
View raw message