Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
I am writing a separate java project as a maven artifact that I can add as a dependency to other projects. This Project is just some special loggers that can be included in logback configuration by other projects as necessary.
But what I am trying to achieve is these loggers are, I need the logs selected by these filters to only print in the particular appender but logs that match the logger but not accepted by the filter to be passed down to the root logger.
Only way the logs not selected by the filter to be printed in the root logger is to make my current logger to set logger attribute `additivity="true"` but this results in also printing the logs selected by my new logger also be printed in the root logger as well.
To fix this i have to add a deny filter to the appenders of root logger to deny the logs that matched my custom logger and appenders.
So when I tried to include the deny filter to the appender using a <include> I get an error as
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:79 - no applicable action for [include], current ElementPath is [[configuration][appender][include]]I am writing a separate java project as a maven artifact that I can add as a dependency to other projects. This Project is just some special loggers that can be included in logback configuration by other projects as necessary. But what I am trying to achieve is these loggers are, I need the logs selected by these filters to only print in the particular appender but logs that match the logger but not accepted by the filter to be passed down to the root logger. Only way the logs not selected by the filter to be printed in the root logger is to make my current logger to set logger attribute `additivity="true"` but this results in also printing the logs selected by my new logger also be printed in the root logger as well. To fix this i have to add a deny filter to the appenders of root logger to deny the logs that matched my custom logger and appenders. So when I tried to include the deny filter to the appender using a <include> I get an error as java.lang.IllegalStateException: Logback configuration error detected: ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:79 - no applicable action for [include] , current ElementPath is [ [configuration] [appender] [include] ]
Description
Would like to be able to use include withing tags like <appender> <logger> etc.
Currently it only supports following.
<configuration> <include/> </configuration>
But would like to have the following.
<configuration> <appender> <include/> <include/> <encoder> </encoder> </appender> </configuration>
This allows other developers to not worry about the content and only use the provided includes to add new filters etc.