[logback-user] commons-compiler required?
ceki at qos.ch
Tue Jan 11 18:36:17 CET 2011
I think commons-compiler is needed for Janino 2.6 and later. Logback was
tested with Janino 2.4.x and 2.5.x.
If you have a need for java-expressions, try GEventEvaluator even if you
are not familiar with the Groovy language. Contrary to
JaninoEventEvaluator which understands simple expressions,
GEventEvaluator can parse blocks of code. As an example, with using
Janino you would write:
( logger.equals("org.apache.http.wire") &&
(mdc != null && mdc.get("entity") != null
In Groovy, this would become:
if(mdc?.get("entity") == null)
String payee = (String) mdc.get("entity");
Note the Groovy expression is almost valid Java. My point is that for
most non-trivial expressions the Groovy version will be easier to write
and to read.
Note that while Groovy has advantages over Java as language, the biggest
difference between JaninoEventEvaluator and GEventEvaluator is due to
the former's limitation to boolean expressions. This limitations is
likely to be removed in a future version of logback.
On 11.01.2011 17:12, Eric Hough wrote:
> I'm using Janino with logback to utilize evaluators after installing
> Janino as described at http://logback.qos.ch/setup.html. It's working
> However I noticed that over on Janino's site
> they require commons-compiler.jar. My question is, does Logback also
> require commons-compiler.jar? I just want to make sure I don't run
> into a ClassNotFoundException down the road.
More information about the Logback-user