Eric,

For this patch you don't necessarily need a commons-logging.properties file
- but the commons-logging.properties file WILL force the logger to
Log4JLogger.   I'm not too familiar any other options in configuring this -
other than setting system properties, etc (which turned out not to work so
reliably).

With the commons-logging.properties file in the WEB-INF/classes directory
you can setup any logger you want and don't need the Log4j.properties file
in the WEB-INF/classes directory anymore.  This being the case, the
"copy-log4j-properties" target in the build.xml file of the TDK can be
changed to copy the commons-logging.properties instead, leaving the
Log4j.properties file in the WEB-INF/conf directory.  If anyone knows of a
way to force commons to pickup the commons-logging.properties file from the
WEB-INF/conf directory that would be ideal - since then we wouldn't need to
copy it to the WEB-INF/classes directory anymore (I personally don't really
like doing the copying).

I will post a patch for Turbine 2.4 log4j deprecation stuff to the
turbine-devel list (plus some other deprecation issues).


Bradford A. Folkens
[EMAIL PROTECTED]
 

-----Original Message-----
From: Eric Pugh [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 05, 2004 6:55 AM
To: Turbine Users List
Subject: RE: Turbine defaults to SimpleLog

For this patch, do you need the commons-logging.properties file?  Could you
maybe update the log4j.properties file in CVS for T2.4 to instead be a
commons-logging.properties file and submit a patch for changing Turbine
against T2.4?

It would be great to get rid some of these deprecation errors!

Eric

> -----Original Message-----
> From: Folkens, Brad [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 23, 2004 11:43 AM
> To: 'Turbine Users List'
> Subject: Turbine defaults to SimpleLog
>
>
> To all who are having problems with the default SimpleLog in
> commons-logging:
>
> Instead of the hack I mentioned a few months ago (I have since messed 
> around with this a lot more), the following works more reliably.
>
>
> 1) Make sure you have the latest commons-logging.jar in your 
> /WEB-INF/lib directory.  (Actually, if you're having the problem in 
> the first place then you probably <do> have the latest 
> commons-logging.jar)
>
> 2) Create a commons-logging.properties file in your /WEB-INF/conf 
> directory that reads:
>
> org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLo
> gg
> er
>
> 3) Copy the commons-logging.properties file to your /WEB-INF/classes 
> directory (this can be put into ant to copy automagically)
>
> (optional 4) Patch the Turbine.java file with the following (this 
> removes Log deprecation warnings):
>
> Index: Turbine.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-turbine-2/src/java/org/apache/turbine/Turbine.
> ja
> va,v
> retrieving revision 1.45
> diff -u -r1.45 Turbine.java
> --- Turbine.java 2 Jul 2003 16:52:24 -0000 1.45
> +++ Turbine.java 23 Apr 2004 15:39:35 -0000
> @@ -77,7 +77,7 @@
>
>  import org.apache.commons.logging.Log;  import 
> org.apache.commons.logging.LogFactory;
> -import org.apache.commons.logging.impl.Log4jFactory;
> +import org.apache.commons.logging.impl.Log4JLogger;
>
>  import org.apache.log4j.PropertyConfigurator;
>
> @@ -266,8 +266,8 @@
>          //
>          // Set up Commons Logging to use the Log4J Logging
>          //
> -        System.getProperties().setProperty(LogFactory.class.getName(),
> -
> Log4jFactory.class.getName());
> +        System.getProperties().setProperty(Log.class.getName(),
> +
> Log4JLogger.class.getName());
>
>          // Set the application root. This defaults to the webapp
>          // context if not otherwise set. This is to allow 2.1 apps
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to