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

[feature/bug] provide a way to get appender instances that are not bound to any logger #124

Open
XSven opened this issue May 30, 2023 · 1 comment

Comments

@XSven
Copy link

XSven commented May 30, 2023

This configuration

log4perl.logger.Foo                               = INFO, STDERR

log4perl.appender.STDERR                          = Log::Log4perl::Appender::Screen
log4perl.appender.STDERR.stderr                   = 1
log4perl.appender.STDERR.layout                   = Log::Log4perl::Layout::PatternLayout::Multiline
log4perl.appender.STDERR.layout.ConversionPattern = %m%n

log4perl.appender.FILE                            = Log::Log4perl::Appender::File
log4perl.appender.FILE.filename                   = file.log
log4perl.appender.FILE.mode                       = append
log4perl.appender.FILE.create_at_logtime          = 1
log4perl.appender.FILE.layout                     = Log::Log4perl::Layout::PatternLayout::Multiline
log4perl.appender.FILE.layout.ConversionPattern   = %m%n

defines a logger Foo and two appenders STDERR and FILE. The STDERR appender is bound to the logger; the FILE is not bound to any logger. It is not possible to get the FILE appender instance using either the class method appender_by_name() or $Log::Log4perl::Logger::APPENDER_BY_NAME{...}.

@XSven XSven changed the title [feature] provide a way to get appender instances that are not bound to any logger [feature/bug] provide a way to get appender instances that are not bound to any logger May 16, 2024
@XSven
Copy link
Author

XSven commented May 16, 2024

Could this be prioritized please. It is really annoying not to be able to configure appenders in a .properties file and bind them to a logger at runtime! Instead we are forced to bind all appenders and at runtime using eradicate_appender() instead.

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

1 participant