[slf4j-user] Reconfigure during runtime

Per Lindberg per.lindberg at facilitylabs.com
Wed Feb 17 14:19:12 CET 2010


Per Lindberg wrote:

> That's reassuring! Now all I have to do is to figure out why
> I can't get it to work as it should. :-)

...and now I finally got it working. I had a trivial bug.
Thanks again for the reassurement, that helped me look
in the right place.

In case anyone is interested, here's what you can do:

String loggerClassPath = request.getParameter("logger-class-path");
String loggerLevel = request.getParameter("logger-level");
org.apache.log4j.Logger.getLogger(loggerClassPath)
   .setLevel(org.apache.log4j.Level.toLevel(loggerLevel));

Works like a charm, even when logging calls then are to slf4j.

Cheers,
Per Lindberg



More information about the slf4j-user mailing list