db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinkan <shin...@gmail.com>
Subject Re: Log4J + Torque ... gonna drive me mad.
Date Fri, 01 Aug 2008 07:30:40 GMT
Hi everyone !

By the way thank you very much everyone involved for clarifying this so
> much.


Thanks you very much as well, this have been really helpful considering the
lack of examples for this situation on the Web.



>
> I have a different opinion about this. Torque does neither initialize
> log4j nor commons-logging. It is up to the user to do this. If you don't
> initialize logging, the standard configuration is used. This is the
> intended behaviour.
>

I agree with that.
But as it's Torque (or commons-logging) which OUTPUT the log messages on the
classes and packages it wants, it should ensure that something could be done
with the Log4j configuration, or guess, or whatever, or at least the Torque
website should have a FAQ which says that this package and this package MUST
have appenders configured, because we're not supposed to know who outputs !!

Then, to conclude, TO HAVE TORQUE LOG WORKING :

- Just put a log4j.properties in your classpath, saying that :
log4j.category.rootCategory = <whatever>
log4j.category.org.apache.commons = <whatever>
log4j.category.org.apache.torque = <whatever>
<rest of config files>

- Put a commons-logging.properties in your classpath with these 2 lines :
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

You need commons-logging and log4j jars (and probably other dependencies) to
make this working, of course.

That's it !
Thanks again everyone !


-- 
Pierre.
With some more efforts, maybe one day Human beings could win against library
configuration :p

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message