[logback-user] Split logs to different files by MDC?
liova_89 at yahoo.ca
Wed Jun 13 23:47:17 CEST 2012
Great, SiftingAppender seems to be what I need, once I can configure it correctly
Could you assist with rolling policy for it? I have a rolling policy that rolls over on size. Whether I put it in the sifting appender
or one of the generated ones
it seems to have no effect in either case. The rolling policy works fine in a separate FileAppender. Is it possible to add a rolling policy for a sifting appender, am I missing something?
From: ceki <ceki at qos.ch>
To: logback users list <logback-user at qos.ch>
Sent: Tuesday, June 12, 2012 4:00:28 PM
Subject: Re: [logback-user] Split logs to different files by MDC?
I'd suggest to re-write the expression as
Are you familiar with SiftingAppender? It seems to address a use case
similar to yours.
On 12.06.2012 20:17, Yura Levandovskyy wrote:
> I have an application that has an mdc variable. How can I make a proper
> filter, so that if variable = test, all such output goes to one file,
> and to another file if variable is anything else?
> I tried the following (not sure how to go from there even if it worked
> mdc?.get("variable") ~= /test/
> but the result is
> ERROR in ch.qos.logback.classic.boolex.JaninoEventEvaluator at 7d55b9f -
> Could not start evaluator with expression [mdc?.get("variable") ~= /test/ )]
> Any suggestions?
Logback-user mailing list
Logback-user at qos.ch
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Logback-user