You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2010/12/21 01:32:26 UTC
svn commit: r1051342 - in /tomcat/trunk:
java/org/apache/juli/logging/DirectJDKLog.java
webapps/docs/config/systemprops.xml
Author: fhanik
Date: Tue Dec 21 00:32:25 2010
New Revision: 1051342
URL: http://svn.apache.org/viewvc?rev=1051342&view=rev
Log:
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.
Modified:
tomcat/trunk/java/org/apache/juli/logging/DirectJDKLog.java
tomcat/trunk/webapps/docs/config/systemprops.xml
Modified: tomcat/trunk/java/org/apache/juli/logging/DirectJDKLog.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/logging/DirectJDKLog.java?rev=1051342&r1=1051341&r2=1051342&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/juli/logging/DirectJDKLog.java (original)
+++ tomcat/trunk/java/org/apache/juli/logging/DirectJDKLog.java Tue Dec 21 00:32:25 2010
@@ -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("");
Modified: tomcat/trunk/webapps/docs/config/systemprops.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/systemprops.xml?rev=1051342&r1=1051341&r2=1051342&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/trunk/webapps/docs/config/systemprops.xml Tue Dec 21 00:32:25 2010
@@ -429,6 +429,14 @@
<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:
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org