This is an automated email from the ASF dual-hosted git repository.

chetanm pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-log.git


The following commit(s) were added to refs/heads/master by this push:
     new eb3a92d  SLING-6482 - Commons Log WebConsole: Exception when creating 
logger with an empty log file
eb3a92d is described below

commit eb3a92d8eb454ff8091e24408d35802006ebba94
Author: Chetan Mehrotra <[email protected]>
AuthorDate: Tue Oct 31 09:54:38 2017 +0530

    SLING-6482 - Commons Log WebConsole: Exception when creating logger with an 
empty log file
---
 .../sling/commons/log/logback/internal/LogConfigManager.java   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/commons/log/logback/internal/LogConfigManager.java
 
b/src/main/java/org/apache/sling/commons/log/logback/internal/LogConfigManager.java
index e4bf32b..61c3295 100644
--- 
a/src/main/java/org/apache/sling/commons/log/logback/internal/LogConfigManager.java
+++ 
b/src/main/java/org/apache/sling/commons/log/logback/internal/LogConfigManager.java
@@ -232,10 +232,6 @@ public class LogConfigManager implements 
LogbackResetListener, LogConfig.LogWrit
         return configByPid.values();
     }
 
-    public Iterable<LogWriter> getLogWriters(){
-        return writerByFileName.values();
-    }
-
     public Appender<ILoggingEvent> getDefaultAppender() {
         OutputStreamAppender<ILoggingEvent> appender = new 
ConsoleAppender<ILoggingEvent>();
         appender.setName(DEFAULT_CONSOLE_APPENDER_NAME);
@@ -555,6 +551,12 @@ public class LogConfigManager implements 
LogbackResetListener, LogConfig.LogWrit
                 pattern = LogConfigManager.LOG_PATTERN_DEFAULT;
             }
 
+            //Map empty fileName to console logger
+            //null fileName is for scenario where intention is just to change 
the log level
+            if (fileName != null && fileName.trim().length() == 0) {
+                fileName = LogWriter.FILE_NAME_CONSOLE;
+            }
+
             // FileName being just null means that we want to change the
             // LogLevel
             if (fileName != null && !isConsole(fileName)) {

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to