Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appenders are created even if their only reference is inside of another appender that does not get referenced #806

Open
Falmarri opened this issue Apr 18, 2024 · 1 comment

Comments

@Falmarri
Copy link

    <appender name="inner" class="ch.qos.logback.core.rolling.RollingFileAppender">
    </appender>
    <appender name="outer" class="net.logstash.logback.appender.LoggingEventAsyncDisruptorAppender">
        <appender-ref ref="inner" />
    </appender>

Using this configuration, the RollingFileAppender gets instantiated even if the LoggingEventAsyncDisruptorAppender doesn't. This is problematic because I only ever reference the Async appender via flags that get evaluated via conditions in environments where the RollingFileAppender has permissions to create the files its referencing.

This works when using the deprecated method of nested appenders

@ceki
Copy link
Member

ceki commented Apr 19, 2024

@Falmarri Which version of logback are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants