[logback-dev] [JIRA] Updates for LOGBACK-1710: Ability to use <include> anywhere not only directly within <configuration>
QOS.CH (JIRA)
noreply-jira at qos.ch
Fri Dec 2 21:31:00 CET 2022
logback / LOGBACK-1710 [Open]
Ability to use <include> anywhere not only directly within <configuration>
==============================
Here's what changed in this issue in the last few minutes.
This issue has been created
This issue is now assigned to you.
View or comment on issue using this link
https://jira.qos.ch/browse/LOGBACK-1710
==============================
Issue created
------------------------------
Missaka Iddamalgoda created this issue on 02/Dec/22 9:18 PM
Summary: Ability to use <include> anywhere not only directly within <configuration>
Issue Type: Improvement
Assignee: Logback dev list
Components: Joran, logback-classic
Created: 02/Dec/22 9:18 PM
Environment:
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 at 10:79 - no applicable action for [include], current ElementPath is [[configuration][appender][include]]
Labels: configuration filter
Priority: Major
Reporter: Missaka Iddamalgoda
Description:
Would like to be able to use include withing tags like <appender> <logger> etc.
Currently it only supports following.
{code:xml}
<configuration>
<include/>
</configuration>
{code}
But would like to have the following.
{code:xml}
<configuration>
<appender>
<include/>
<include/>
<encoder>
</encoder>
</appender>
</configuration>
{code}
This allows other developers to not worry about the content and only use the provided includes to add new filters etc.
==============================
This message was sent by Atlassian Jira (v8.8.0#808000-sha1:e2c7e59)
More information about the logback-dev
mailing list