vy commented on code in PR #2280:
URL: https://github.com/apache/logging-log4j2/pull/2280#discussion_r1486045602
##########
log4j-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java:
##########
@@ -113,13 +149,33 @@ public void log(final StatusData data) {
@Deprecated
public void setFilters(final String... filters) {}
+ /**
+ * Resets the level and output stream to its initial values, and closes
the output stream, if it is a non-system one.
+ */
@Override
- public void close() throws IOException {
- // Get local copy of the `volatile` member
- final OutputStream localStream = stream;
+ public void close() {
+ final OutputStream oldStream;
+ lock.lock();
+ try {
+ oldStream = stream;
+ stream = initialStream;
+ level = initialLevel;
+ } finally {
+ lock.unlock();
+ }
+ closeNonSystemStream(oldStream);
+ }
Review Comment:
No, because `StatusConsoleListener`, (i.e., the fallback listener) might
have been explicitly provided in the `StatusLogger` ctor. Hence, it is not
correct to assume that the fallback listener is always `new
StatusConsoleListener(Config.getInstance().fallbackListenerLevel)`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]