From: ceki <ceki@qos.ch>
To: logback users list <logback-user@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
((String))mdc.get("variable").matches("/test/")
Are you familiar with SiftingAppender? It seems to address a use case
similar to yours.
HTH,
[1]
http://logback.qos.ch/manual/appenders.html#SiftingAppender--
Ceki
http://twitter.com/#!/cekiOn 12.06.2012 20:17, Yura Levandovskyy wrote:
> Hello
>
> 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
> though):
>
> <expression>
> mdc?.get("variable") ~= /test/
> </expression>
>
> but the result is
>
> ERROR in ch.qos.logback.classic.boolex.JaninoEventEvaluator@7d55b9f -
> Could not start evaluator with expression [mdc?.get("variable") ~= /test/ )]
>
> Any suggestions?
>
> Thanks
>
_______________________________________________
Logback-user mailing list
Logback-user@qos.chhttp://mailman.qos.ch/mailman/listinfo/logback-user