You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if this would be considered a bug or works-as-designed.
I am currently implementing a custom Configuration which does not inherit from AbstractConfiguration- but I am borrowing a lot of the behaviour from AbstractConfiguration.
In the 'AbstractConfiguration#stop()' method, the appenders are cleared from all LoggerConfigs after stopping the appenders.
This uses the package-protected LoggerConfig#clearAppenders() method.
LoggerConfig
protected void clearAppenders() {
do {
final AppenderControl[] original = appenders.clear();
for (final AppenderControl ctl : original) {
cleanupFilter(ctl);
}
} while (!appenders.isEmpty());
}
Since this is package-protected; I cannot provide the same functionality with a custom Configuration implementation.
NOTE: Why am I doing this? My implementation is not Node based. I am capturing all configuration from the configuration XML so that I will be able to write a new XML at runtime with changes added from an Admin-Client UI (i.e. new/updated Loggers/Appenders).
My workaround is a static utility method in a custom-class pushed into the LoggerConfig package - which will only work as long as we are not using Java module-system.
The text was updated successfully, but these errors were encountered:
LoggerConfig (Log4j 2.24.1)
I am not sure if this would be considered a bug or works-as-designed.
I am currently implementing a custom
Configuration
which does not inherit fromAbstractConfiguration
- but I am borrowing a lot of the behaviour fromAbstractConfiguration
.In the 'AbstractConfiguration#stop()' method, the appenders are cleared from all
LoggerConfig
s after stopping the appenders.This uses the package-protected
LoggerConfig#clearAppenders()
method.LoggerConfig
Since this is package-protected; I cannot provide the same functionality with a custom
Configuration
implementation.NOTE: Why am I doing this? My implementation is not
Node
based. I am capturing all configuration from the configuration XML so that I will be able to write a new XML at runtime with changes added from an Admin-Client UI (i.e. new/updated Loggers/Appenders).My workaround is a static utility method in a custom-class pushed into the LoggerConfig package - which will only work as long as we are not using Java module-system.
The text was updated successfully, but these errors were encountered: