ppkarwasz commented on code in PR #1592:
URL: https://github.com/apache/logging-log4j2/pull/1592#discussion_r1274555963


##########
log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java:
##########
@@ -139,7 +139,7 @@ private StatusLogger(
             final MessageFactory messageFactory,
             final SimpleLoggerFactory loggerFactory) {
         super(name, messageFactory);
-        final Level loggerLevel = DEBUG_ENABLED ? Level.TRACE : Level.ERROR;
+        final Level loggerLevel = DEBUG_ENABLED ? Level.TRACE : Level.WARN;

Review Comment:
   It would be probably useful to set this to 
`StatusLogger#DEFAULT_STATUS_LEVEL` here, so we can control it with a system 
property.



##########
log4j-core/src/main/java/org/apache/logging/log4j/core/config/status/StatusConfiguration.java:
##########
@@ -39,7 +39,7 @@ public class StatusConfiguration {
 
     @SuppressWarnings("UseOfSystemOutOrSystemErr")
     private static final PrintStream DEFAULT_STREAM = System.out;
-    private static final Level DEFAULT_STATUS = Level.ERROR;
+    private static final Level DEFAULT_STATUS = Level.WARN;

Review Comment:
   Same as above: it should be the same value as the one returned by 
`AbstractConfiguration#getDefaultStatusLevel()`.
   
   Maybe `AbstractConfiguration#getDefaultStatusLevel()` should be rewritten in 
terms of this field.



##########
log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java:
##########
@@ -471,11 +471,11 @@ public void setup() {
 
     protected Level getDefaultStatus() {
         final String statusLevel = 
PropertiesUtil.getProperties().getStringProperty(
-                Constants.LOG4J_DEFAULT_STATUS_LEVEL, Level.ERROR.name());
+                Constants.LOG4J_DEFAULT_STATUS_LEVEL, Level.WARN.name());

Review Comment:
   If `Constants.LOG4J_DEFAULT_STATUS_LEVEL` is unset 
("log4j2.defaultStatusLevel"), I would first fall back onto the value of the 
property `StatusLogger.DEFAULT_STATUS_LISTENER_LEVEL` 
("log4j2.statusLoggerLevel") and fall back to "WARN" if it fails.



-- 
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: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to