[logback-user] Passing logger level via parameter or determining programmatically?

Smith, Larry (ECS - Enterprise Cloud Service) larry.smith5 at hp.com
Fri Oct 5 18:27:50 CEST 2012


Hi all,

Is there any way to accomplish setting a log level (error, warn, ...) via a parameter, so that I do not have to explicitly code logger.error(...), logger.warn(...)?

I would like to be able to code something like logger.log("foo={}", foo); 
and have it determine the level based on a previously set value.

If I could do something like this, then I could change the logging level dynamically in specific classes, rather than changing the level for an entire class as I've seen discussed in the past.

Thanks,
Larry Smith


More information about the Logback-user mailing list