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
In Log4j 2 managers are reference counted: if you have two FileAppenders writing to the same file, there will be a single FileManager with a reference count of 2.
Calling stop() on a stopped appender always calls stop() on the underlying manager. In the situation described above it is effectively possible to stop both file appender by calling stop() twice on one of them.
This a problem, because those appenders might not even be in the same configuration or attached to the same logger context.
Configuration
Version: up to 2.20.0 and 3.0.0-alpha1
Reproduction
Call stop() multiple times on a file appender. All other appenders pointing to the same file will stop logging.
The text was updated successfully, but these errors were encountered:
jvz
added
bug
Incorrect, unexpected, or unintended behavior of existing code
plugins
Affects the plugin system
appenders
Affects one or more Appender plugins
and removed
plugins
Affects the plugin system
labels
Oct 15, 2023
Description
In Log4j 2 managers are reference counted: if you have two
FileAppender
s writing to the same file, there will be a singleFileManager
with a reference count of 2.Calling
stop()
on a stopped appender always callsstop()
on the underlying manager. In the situation described above it is effectively possible to stop both file appender by callingstop()
twice on one of them.This a problem, because those appenders might not even be in the same configuration or attached to the same logger context.
Configuration
Version: up to 2.20.0 and 3.0.0-alpha1
Reproduction
Call
stop()
multiple times on a file appender. All other appenders pointing to the same file will stop logging.The text was updated successfully, but these errors were encountered: