You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Remke Rutgers <Re...@brightalley.nl> on 2003/01/06 15:53:38 UTC

Torque and log4j problems

Hello fellow torque-users,

I had great problems getting torque to generate logfiles for my webapp.
I had two webapps, both using torque. One did create logfiles, the other did
not.
After some debugging, I found out that the call to isLoggingConfigured() in
Torque.java returned true for the webapp NOT creating logfiles. 
I removed the other webapp from my tomcat installation, because I feared a
conflict.
Shutdown tomcat, start tomcat, still no logfiles. The call to
isLoggingConfigured() in Torque.java still returned true.
    protected static boolean isLoggingConfigured()
    {
	.....
        Enumeration enum = Category.getRoot().getAllAppenders();

        if (!(enum instanceof NullEnumeration))
        {
            return true;
        }
	...........
    }

Apparently there already was an appender attached to the root Category.
Doing step by step debugging and variable inspection, I found out this one
was created by initialize() in Log4JCategoryLog in commons-logging.jar.
Turned out I used different versions of commons-logging.jar in the two
webapps. 
I know, I should have noticed that earlier, but I didn't.

The working version was 1.0.1, the version not working was 1.0.2.

I put version 1.0.1 of commons-logging.jar in both webapps now and it works,
but it feels like a bad trick. 
I think torque logging should work with commons-logging 1.0.2 as well. Or
maybe commons-logging takes an incorrect approach???
Any thoughts on this appreciated.

Btw, the documentation for Log4j version 1.2.7 tells:
Category
This class has been deprecated and replaced by the Logger subclass. It will
be kept around to preserve backward compatibility until mid 2003. 

Are there plans to replace references to Category in torque code?

Remke Rutgers
Technisch Consultant Knowledge & Learning

Bright Alley Knowledge & Learning
Media Park - Sumatralaan 45
Postbus 158 - 1200 AD Hilversum
Web www.brightalley.com
Telefoon direct (035) 6775668
Fax (035) 6774355
E-mail remke.rutgers@brightalley.nl