[JIRA] Created: (LBCLASSIC-103) Accidental incompatible joran syntax for evaluator filters

Accidental incompatible joran syntax for evaluator filters ---------------------------------------------------------- Key: LBCLASSIC-103 URL: http://jira.qos.ch/browse/LBCLASSIC-103 Project: logback-classic Issue Type: Bug Components: joran Affects Versions: 0.9.14 Reporter: Michael Franz Assignee: Logback dev list The release note for 0.9.14 states: "In addition, EvaluatorAction has been modified to accept evaluators of any type and not just instances of JaninoEvaluator." Firstly: I could not found this documented within the manual. Secondly: The examples for evaluator filters within appenders from the manual do no longer work, e.g. logback-examples/src/main/java/chapter6/basicEventEvaluator.xml: <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <filter class="ch.qos.logback.core.filter.EvaluatorFilter"> <evaluator name="myEval"> <expression>message.contains("billing")</expression> </evaluator> <OnMismatch>NEUTRAL</OnMismatch> <OnMatch>DENY</OnMatch> </filter> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern> %-4relative [%thread] %-5level %logger - %msg%n </pattern> </layout> </appender> The error message is: |-ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - No class name attribute in [evaluator] After adding class="ch.qos.logback.classic.boolex.JaninoEventEvaluator" to the evaluator tag it works. But this should not be required. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-103?page=com.atlassian.jira.plugin.syste... ] Ceki Gulcu resolved LBCLASSIC-103. ---------------------------------- Fix Version/s: 0.9.15 Resolution: Fixed Hello Michael, Thank you very much for this report. As explained in revision 2130, http://svn.qos.ch/viewvc?root=svn&revision=2130&pathrev=2130&view=rev Joran is now able to assume a default type for nested components according to rules declared in a JoranConfigurator instance. The rules are located in an instance of the DefaultNestedComponentRegistry class. Thus, in many cases it will no longer be necessary to declare the class of a component in configuration files. Since the logback-classic and logback-access modes have their own JoranConfigurator classes, it is now possible to register rules specific to each logback module. For example, there is now a rule which maps the layout of an appender to a c.q.l.classic.PatternLayout instance for all appenders in logback-classic and to and instance of c.q.l.access.PatternLayout for all appenders in logback-access. There is also a rule that by default maps the "evaluator" property in the ch.qos.logback.core.filter.EvaluatorFilter class to ch.qos.logback.classic.boolex.JaninoEventEvaluator, thus fixing this bug.
Accidental incompatible joran syntax for evaluator filters ----------------------------------------------------------
Key: LBCLASSIC-103 URL: http://jira.qos.ch/browse/LBCLASSIC-103 Project: logback-classic Issue Type: Bug Components: joran Affects Versions: 0.9.14 Reporter: Michael Franz Assignee: Ceki Gulcu Fix For: 0.9.15
The release note for 0.9.14 states: "In addition, EvaluatorAction has been modified to accept evaluators of any type and not just instances of JaninoEvaluator." Firstly: I could not found this documented within the manual. Secondly: The examples for evaluator filters within appenders from the manual do no longer work, e.g. logback-examples/src/main/java/chapter6/basicEventEvaluator.xml: <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <filter class="ch.qos.logback.core.filter.EvaluatorFilter"> <evaluator name="myEval"> <expression>message.contains("billing")</expression> </evaluator> <OnMismatch>NEUTRAL</OnMismatch> <OnMatch>DENY</OnMatch> </filter> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern> %-4relative [%thread] %-5level %logger - %msg%n </pattern> </layout> </appender> The error message is: |-ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - No class name attribute in [evaluator] After adding class="ch.qos.logback.classic.boolex.JaninoEventEvaluator" to the evaluator tag it works. But this should not be required.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
participants (2)
-
Ceki Gulcu (JIRA)
-
Michael Franz (JIRA)