[logback-user] Always log, regardless of level, but not as ERROR

dirk ooms dirk at onesparrow.com
Tue Sep 15 15:41:11 CEST 2009


use a dedicated logger and appender for this message (which can not be
tweeked by jmx)?

On Tue, 2009-09-15 at 06:31 -0700, laboo wrote:
> I'm looking for a way to always log a message regardless of the current level
> of logger.
> 
> My application allows the user to change the level via JMX and I always want
> to log a message that says, "The level was changed from X to Y".
> 
> I *could* accomplish this by specifying the highest level, ERROR, but it's
> not an error, and I don't want it to show up as one.
> 
> In log4j, I was able to accomplish this by using the log() method with level
> OFF (strangely enough). I tried doing something similar with logback's level
> ALL, but it's not accepted as valid level to the log() method.
> 
> Is there a different/better way to accomplish this?
> 
> Thanks,
> 
> Laboo
> 



More information about the Logback-user mailing list