From 3b6b9029921e9b98ae6b828c061ebf87eecfe9da Mon Sep 17 00:00:00 2001 From: fhanik Date: Tue, 21 Dec 2010 00:32:25 +0000 Subject: [PATCH] Add in a default that doesnt throw a ClassNotFoundException that is simply ignored, and allow a fast way to change the console formatter through a system property when no config file is used. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1051342 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/juli/logging/DirectJDKLog.java | 8 ++++---- webapps/docs/config/systemprops.xml | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/java/org/apache/juli/logging/DirectJDKLog.java b/java/org/apache/juli/logging/DirectJDKLog.java index 5da0ceac1..33d8ce036 100644 --- a/java/org/apache/juli/logging/DirectJDKLog.java +++ b/java/org/apache/juli/logging/DirectJDKLog.java @@ -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(""); diff --git a/webapps/docs/config/systemprops.xml b/webapps/docs/config/systemprops.xml index f2dc78eca..98684bbe9 100644 --- a/webapps/docs/config/systemprops.xml +++ b/webapps/docs/config/systemprops.xml @@ -429,6 +429,14 @@ + +

If no logging configuration file is specified and no logging configuration class is specified + using the java.util.logging.config.class and java.util.logging.config.file + properties the default logging framework org.apache.juli will use the default + java.util.logging.SimpleFormatter for all console output. + To simply override the console output formatter, one can use the described property. Example: + -Dorg.apache.juli.formatter=org.apache.juli.OneLineFormatter

+

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: -- 2.11.0