[logback-dev] [JIRA] Created: (LBCLASSIC-258) Support expression evaluation in scan attribute
Stevo Slavic (JIRA)
noreply-jira at qos.ch
Fri Mar 25 17:45:52 CET 2011
Support expression evaluation in scan attribute
Issue Type: New Feature
Affects Versions: 0.9.28
Reporter: Stevo Slavic
Assignee: Logback dev list
At the moment (logback-classic 0.9.28) processScanAttrib method in ConfigurationAction only checks if scan attribute is not empty and if it's not equal to false (so true, but also any non empty string other than false) is enough to enable configuration changes scanning.
Please add support for expression evaluation (like here: http://logback.qos.ch/manual/configuration.html#conditional ) in scan attribute for the same reason conditional processing of configuration files has been added - so single configuration file can be used in different environments.
E.g. I'd like to configure scan attribute with following expression:
<configuration scan='property("app.env").equals("production")' scanPeriod='300 seconds'>
If janino is not on classpath, same logic can remain for backward compatibility. If janino library is on classpath, and scan is not empty, evaluation should occur - if scan attribute value evaluates to true, only then scanning should be enabled; if scan is not empty and evaluates to false, scanning should not be enabled; if scan is not empty and evaluates to neither true nor false, or exception is thrown, error should be logged.
This would break backward compatibility only for users which configured scan attribute with non-empty value, which is neither "true" nor "false".
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
More information about the logback-dev