[logback-user] ThrowableProxy and instanceof in EventEvaluator
Hontvári József
hontvari at flyordie.com
Mon Sep 28 10:15:50 CEST 2009
Here is a stack trace, dumped from the evaluator expression. It does
include a ThrowableProxyConverter.convert call.
java.lang.Exception: Stack
trace
at
java.lang.Thread.dumpStack(Thread.java:1206)
at
mireka.E.f(E.java:21)
at
SC.eval0(SC.java:3)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.janino.ScriptEvaluator.evaluate(ScriptEvaluator.java)
at
org.codehaus.janino.ScriptEvaluator.evaluate(ScriptEvaluator.java)
at
ch.qos.logback.core.boolex.JaninoEventEvaluatorBase.evaluate(JaninoEventEvaluatorBase.java:53)
at
ch.qos.logback.classic.pattern.ThrowableProxyConverter.convert(ThrowableProxyConverter.java:109)
at
ch.qos.logback.classic.pattern.ThrowableProxyConverter.convert(ThrowableProxyConverter.java:31)
at
ch.qos.logback.core.pattern.FormattingConverter.write(FormattingConverter.java:32)
at
ch.qos.logback.core.pattern.PatternLayoutBase.writeLoopOnConverters(PatternLayoutBase.java:110)
at
ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:132)
at
ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:51)
at
ch.qos.logback.core.WriterAppender.subAppend(WriterAppender.java:267)
at
ch.qos.logback.core.WriterAppender.append(WriterAppender.java:117)
at
ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:89)
at
ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:60)
at
ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:271)
at
ch.qos.logback.classic.Logger.callAppenders(Logger.java:258)
at
ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:440)
at
ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:394)
at
ch.qos.logback.classic.Logger.debug(Logger.java:517)
at
org.subethamail.smtp.server.Session.run(Session.java:119)
Hontvári József írta:
> In an event evaluator called in an option of an "ex" formatting
> specifier I would use a "throwable instanceof example" expression.
> This is the same as in Example 5.3 in the documentation, which also
> uses instanceof.
>
> This doesn't work because the throwable object is not a Throwable but
> a ThrowableProxy.
>
> Again, at another place, in the table at the beginning of the
> "Evaluator Filters taking Java Expressions" section in chapter Filters
> it is shown that the type of throwable is Throwable (annd not
> ThrowableProxy).
>
> Somehow I still get a ThrowableProxy instead of Throwable.
>
>
>
>
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
>
More information about the Logback-user
mailing list