Author: fmeschbe
Date: Wed Dec  2 10:30:19 2009
New Revision: 886104

URL: http://svn.apache.org/viewvc?rev=886104&view=rev
Log:
SLING-1217 Apply patch supplied by Marc Speck (thanks alot) preventing NPE when 
disablig loggers.

Modified:
    
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/RequestLogger.java

Modified: 
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/RequestLogger.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/RequestLogger.java?rev=886104&r1=886103&r2=886104&view=diff
==============================================================================
--- 
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/RequestLogger.java
 (original)
+++ 
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/RequestLogger.java
 Wed Dec  2 10:30:19 2009
@@ -194,6 +194,9 @@
                 REQUEST_LOG_ENTRY_FORMAT, requestLogName, requestLogType);
             this.requestLogExit = 
this.createRequestLoggerService(bundleContext, false,
                 REQUEST_LOG_EXIT_FORMAT, requestLogName, requestLogType);
+            
+            this.bindRequestLoggerService(this.requestLogEntry);
+            this.bindRequestLoggerService(this.requestLogExit);
         }
 
         // prepare the access logger if a name is configured and the
@@ -207,12 +210,9 @@
 
             this.accessLog = this.createRequestLoggerService(bundleContext, 
false,
                 ACCESS_LOG_FORMAT, accessLogName, accessLogType);
-        }
 
-        // finally have the loggers added to the respective lists for later use
-        this.bindRequestLoggerService(this.requestLogEntry);
-        this.bindRequestLoggerService(this.requestLogExit);
-        this.bindRequestLoggerService(this.accessLog);
+            this.bindRequestLoggerService(this.accessLog);
+        }
     }
 
     /**


Reply via email to