Setting the level on a Logger is almost pointless.  You really want to set the 
level on a LoggerConfig. When the level on the LoggerConfig is changed you have 
to call updateLoggers so that all the relevant Loggers will notice the change.

FWIW, there are several missing methods to allow better programmatic 
configuration. I have been planning on doing that but got sidetracked with 
custom levels.

Ralph

On Jan 31, 2014, at 10:01 AM, Gary Gregory <garydgreg...@gmail.com> wrote:

> Porting from v1...
> 
> We do not have Logger setLevel(Level) because it is not in the LCD API (Slf4j 
> no, Logback yes, JUL yes). 
> 
> This sure makes it a pain to port from v1. 
> 
> What are the choices?
> 
> - I hard code everything to the Core Logger API, possible if inflexible.
> - I add a util method that checks the Logger instance to see if it is a Core 
> Logger or if it is a Slf4j logger that wraps a logback logger? Bleh.
> 
> Or, we can add setLevel and have it propagate the call down. Then we can 
> discuss whether a missing API in the underlying system means a noop or an 
> exception. Like JRE Collections do.
> 
> Thoughts?
> 
> Gary
> 
> -- 
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org 
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

Reply via email to