Add in a default that doesnt throw a ClassNotFoundException that is simply ignored...
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 21 Dec 2010 00:32:25 +0000 (00:32 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 21 Dec 2010 00:32:25 +0000 (00:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1051342 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/juli/logging/DirectJDKLog.java
webapps/docs/config/systemprops.xml

index 5da0cea..33d8ce0 100644 (file)
@@ -23,7 +23,6 @@ import java.util.logging.Handler;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-
 /** 
  * Hardcoded java.util.logging commons-logging implementation.
  * 
@@ -36,8 +35,9 @@ class DirectJDKLog implements Log {
     
     /** Alternate config reader and console format 
      */
-    private static final String SIMPLE_FMT="org.apache.tomcat.util.log.JdkLoggerFormatter";
-    private static final String SIMPLE_CFG="org.apache.tomcat.util.log.JdkLoggerConfig";
+    private static final String SIMPLE_FMT="java.util.logging.SimpleFormatter";
+    private static final String SIMPLE_CFG="org.apache.juli.JdkLoggerConfig"; //doesn't exist
+    private static final String FORMATTER="org.apache.juli.formatter";
 
     static {
         if( System.getProperty("java.util.logging.config.class") ==null  &&
@@ -49,7 +49,7 @@ class DirectJDKLog implements Log {
             } catch( Throwable t ) {                
             }
             try {
-                Formatter fmt=(Formatter)Class.forName(SIMPLE_FMT).newInstance();
+                Formatter fmt=(Formatter)Class.forName(System.getProperty(FORMATTER, SIMPLE_FMT)).newInstance(); 
                 // it is also possible that the user modified jre/lib/logging.properties - 
                 // but that's really stupid in most cases
                 Logger root=Logger.getLogger("");
index f2dc78e..98684bb 100644 (file)
 
   <properties>
 
+    <property name="org.apache.juli.formatter">
+      <p>If no logging configuration file is specified and no logging configuration class is specified
+         using the <code>java.util.logging.config.class</code> and <code>java.util.logging.config.file</code>
+         properties the default logging framework <code>org.apache.juli</code> will use the default 
+         <code>java.util.logging.SimpleFormatter</code> for all console output. 
+         To simply override the console output formatter, one can use the described property. Example: 
+         <code>-Dorg.apache.juli.formatter=org.apache.juli.OneLineFormatter</code></p>
+    </property>
     <property name="org.apache.juli.AsyncOverflowDropType">
       <p>When the memory limit of records has been reached the system needs to determine what action to take.
          Currently there are three actions that can be taken: