sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1615862 - /sling/trunk/contrib/extensions/logback-groovy-fragment/README.md
Date Tue, 05 Aug 2014 04:48:04 GMT
Author: chetanm
Date: Tue Aug  5 04:48:04 2014
New Revision: 1615862

URL: http://svn.apache.org/r1615862
Log:
SLING-3814 - Groovy fragment bundle for Commons Log to support scriptable event evaluation

Updated readme with details related to ILoggingEvent variable accessible to script

Modified:
    sling/trunk/contrib/extensions/logback-groovy-fragment/README.md

Modified: sling/trunk/contrib/extensions/logback-groovy-fragment/README.md
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/logback-groovy-fragment/README.md?rev=1615862&r1=1615861&r2=1615862&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/logback-groovy-fragment/README.md (original)
+++ sling/trunk/contrib/extensions/logback-groovy-fragment/README.md Tue Aug  5 04:48:04 2014
@@ -10,7 +10,7 @@ if you need logging only from session cr
 can be done in following way
 
     <?xml version="1.0" encoding="UTF-8"?>
-    <configuration>
+    <configuration scan="true" scanPeriod="1 second">
       <jmxConfigurator/>
       <newRule pattern="*/configuration/osgi" actionClass="org.apache.sling.commons.log.logback.OsgiAction"/>
       <newRule pattern="*/configuration/appender-ref-osgi" actionClass="org.apache.sling.commons.log.logback.OsgiAppenderRefAction"/>
@@ -20,7 +20,7 @@ can be done in following way
         <filter class="ch.qos.logback.core.filter.EvaluatorFilter">      
           <evaluator class="ch.qos.logback.classic.boolex.GEventEvaluator"> 
             <expression><![CDATA[
-                return event.getThreadName().contains("JobHandler");
+                return e.getThreadName().contains("JobHandler");
             ]]></expression>
           </evaluator>
           <OnMismatch>DENY</OnMismatch>
@@ -38,7 +38,10 @@ can be done in following way
       </logger>
     </configuration>
     
-Above logback config would route all log messages from `org.apache.jackrabbit.oak.jcr.operations`
+Logback exposes a variable `e` which is of type [ILoggingEvent][1]. It provides access to
current logging
+event. Above logback config would route all log messages from `org.apache.jackrabbit.oak.jcr.operations`
 category to `${sling.home}/logs/oak.log`. Further only those log messages would be logged
 where the `threadName` contains `JobHandler`. Depending on the requirement the expression
can
-be customised.
\ No newline at end of file
+be customised.
+
+[1]: http://logback.qos.ch/apidocs/ch/qos/logback/classic/spi/ILoggingEvent.html
\ No newline at end of file



Mime
View raw message