Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.8.2
-
None
Description
The documentation on the LoggerNameLevelRewritePolicy is wrong:
Following the example in the documentation gives an error.
<LoggerNameLevelRewritePolicy loggerName="com.foo.bar"> <KeyValuePair key="INFO" value="DEBUG"/> <KeyValuePair key="WARN" value="INFO"/> </LoggerNameLevelRewritePolicy>
The loggerName does not exist, resulting in this error:
2017-08-16 13:46:13,712 main ERROR LoggerNameLevelRewritePolicy contains an invalid element or attribute "loggerName"
The implementation looks like this, it appears that the configuration should use logger instead:
@PluginFactory public static LoggerNameLevelRewritePolicy createPolicy( // @formatter:off @PluginAttribute("logger") final String loggerNamePrefix, @PluginElement("KeyValuePair") final KeyValuePair[] levelPairs) { ...
I think loggerName is a more descriptive name for the attribute, but users may already be using logger after checking the implementation.
Can we give this attribute an alias so that both loggerName and logger work? That way we can keep the current (descriptive) documentation and avoid breaking users existing configuration.