svn commit: r1633570 - in /ofbiz/branches/release13.07: ./ framework/base/config/log4j2.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1633570 - in /ofbiz/branches/release13.07: ./ framework/base/config/log4j2.xml

jleroux@apache.org
Author: jleroux
Date: Wed Oct 22 09:23:51 2014
New Revision: 1633570

URL: http://svn.apache.org/r1633570
Log:
"Applied fix from trunk for revision: 1633550 " (Conflicts handled by hand, surely done: same file than in trunk HEAD)
------------------------------------------------------------------------
r1633550 | jacopoc | 2014-10-22 09:50:08 +0200 (mer. 22 oct. 2014) | 7 lignes

Some modifications to the default configuration of log4j2:
1) added a comment to summarize the default configuration, with a reference to the online log4j2 documentation for further customizations
2) added a new appender for errors (or greater); implemented using a filter to keep the logger definition as clean as possible
3) removed the external appender because the amount of log statements (warnings or greater) from external jars is not large and should not cause much confusion if we keep them with OFBiz log statements
4) increased the number of rolling files for ofbiz.log to 10
5) changed date format to "yyyy-mm-dd hh:mm:ss.sss"

------------------------------------------------------------------------

Modified:
    ofbiz/branches/release13.07/   (props changed)
    ofbiz/branches/release13.07/framework/base/config/log4j2.xml

Propchange: ofbiz/branches/release13.07/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1633550

Modified: ofbiz/branches/release13.07/framework/base/config/log4j2.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/base/config/log4j2.xml?rev=1633570&r1=1633569&r2=1633570&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/base/config/log4j2.xml (original)
+++ ofbiz/branches/release13.07/framework/base/config/log4j2.xml Wed Oct 22 09:23:51 2014
@@ -1,46 +1,48 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Configuration monitorInterval="60">
+    <!--
+      Default configuration for logging; for customizations refer to http://logging.apache.org/log4j/2.x/manual/configuration.html.
+      With this configuration the following behavior is defined:
+       * all log messages of severity "warning" or greater, generated by external jars, are logged in the ofbiz.log file and in the console
+       * all log messages of any severity, generated by OFBiz, are logged in the ofbiz.log file and in the console
+       * all log messages of severity "error" or greater are also logged in the error.log file
+      When the ofbiz.log file reaches 1MB in size a new file is created and a date/sequence suffix is added; up to 10 files are kept.
+      When the error.log file reaches 1MB in size a new file is created and a date/sequence suffix is added; up to 3 files are kept.
+      The settings in this configuration file can be changed without restarting the instance: every 60 seconds the file is checked for modifications.
+    -->
     <Appenders>
         <Console name="stdout" target="SYSTEM_OUT">
-            <PatternLayout pattern="%date{COMPACT} |%-20.20thread |%-20.20logger{1}|%level{length=1}| %message%n"/>
+            <PatternLayout pattern="%date{DEFAULT} |%-20.20thread |%-30.30logger{1}|%level{length=1}| %message%n"/>
         </Console>
         <RollingFile name="ofbiz" fileName="runtime/logs/ofbiz.log"
-                     filePattern="runtime/logs/ofbiz-%d{yyyy-MM-dd}-%i.log.zip">
-            <PatternLayout pattern="%date{COMPACT} |%-20.20thread |%-20.20logger{1}|%level{length=1}| %message%n"/>
+                     filePattern="runtime/logs/ofbiz-%d{yyyy-MM-dd}-%i.log">
+            <PatternLayout pattern="%date{DEFAULT} |%-20.20thread |%-30.30logger{1}|%level{length=1}| %message%n"/>
             <Policies>
                 <TimeBasedTriggeringPolicy/>
                 <SizeBasedTriggeringPolicy size="1 MB"/>
             </Policies>
-            <DefaultRolloverStrategy max="4"/>
+            <DefaultRolloverStrategy max="10"/>
         </RollingFile>
-        <RollingFile name="external" fileName="runtime/logs/external.log"
-                     filePattern="runtime/logs/external-%d{yyyy-MM-dd}-%i.log.zip">
-            <PatternLayout pattern="%date{COMPACT} |%-20.20thread |%-20.20logger{1}|%level{length=1}| %message%n"/>
+        <RollingFile name="error" fileName="runtime/logs/error.log"
+                     filePattern="runtime/logs/error-%d{yyyy-MM-dd}-%i.log">
+            <ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
+            <PatternLayout pattern="%date{DEFAULT} |%-20.20thread |%-30.30logger{1}|%level{length=1}| %message%n"/>
             <Policies>
                 <TimeBasedTriggeringPolicy/>
                 <SizeBasedTriggeringPolicy size="1 MB"/>
             </Policies>
-            <DefaultRolloverStrategy max="4"/>
+            <DefaultRolloverStrategy max="3"/>
         </RollingFile>
         <Async name="async">
             <AppenderRef ref="ofbiz"/>
             <AppenderRef ref="stdout"/>
+            <AppenderRef ref="error"/>
         </Async>
     </Appenders>
     <Loggers>
         <logger name="org.ofbiz.base.converter.Converters" level="warn"/>
-        <logger name="org.apache" level="warn" additivity="false">
-            <appender-ref ref="external"/>
-        </logger>
-        <logger name="org.apache.tomcat" level="info" additivity="true">
-            <appender-ref ref="external"/>
-        </logger>
-        <logger name="org.apache.catalina" level="info" additivity="true">
-            <appender-ref ref="external"/>
-        </logger>
-        <logger name="freemarker" level="warn" additivity="false">
-            <appender-ref ref="external"/>
-        </logger>
+        <logger name="org.apache" level="warn"/>
+        <logger name="freemarker" level="warn"/>
 
         <Root level="all">
             <AppenderRef ref="async"/>