[logback-user] Setting log LEVEL on a per <appender-ref/> basis
ceki
ceki at qos.ch
Sun May 6 12:53:19 CEST 2012
Hi Shane,
You could not have possibly be aware of RoutingAppender because it does
not exist yet. For the moment, it's just an idea for solving the problem
you described in your message. Browsing through logback documentation
and source code should give you ideas about writing a RoutingAppender.
Of course, once you get started you can ask for feedback here.
Cheers,
--
Ceki
http://twitter.com/#!/ceki
On 05.05.2012 23:35, Shane Kelly wrote:
> Hi Ceki,
>
> Thanks for your prompt response. I wasn't aware of routing appenders -
> so this is something that I shall certainly look into. My main
> motivation for wanting to do this was primarily so that I could control
> the verboseness of logging for the same logger depending on the
> destination appender without having to create several (almost duplicate)
> appender configurations (whilst setting slightly different threshold
> levels for each) - as far as possible I only wanted to create a single
> appender configuration entry for each distinct destination - i.e.
> Console, RollingFile etc. So, for example, I might have a logger in a
> Java class which generates log messages of varying levels, but I only
> want INFO and above to go to a Console appender, whilst I want DEBUG and
> above to be written to a RollingFileAppender - for the same class -
> simply because I don't want to clog up STDOUT with too much information
> (unless I need to) but have a separate file to fall back to which does
> contain a complete set of log messages for reference/debug at a later date.
>
> Is there any documentation describing how to create routing appenders (I
> had a quick look and couldn't see anything) or is there an example of
> such an appender lurking somewhere within the source that you could
> point me towards?
>
> Regards,
>
> Shane
>
More information about the Logback-user
mailing list