[prev in list] [next in list] [prev in thread] [next in thread] 

List:       turbine-torque-dev
Subject:    Re: Log4j not initialized in Torque.
From:       "Peter S. Hamlen" <phamlen () linkfoundation ! com>
Date:       2002-06-26 23:07:24
[Download RAW message or body]

Humberto,

We encountered some problems/issues on this just this week.  Our
work-around was to create a "log4j.properties" file that has all our
appenders - and not rely on the Torque.properties file at all for
logging.  We initialize Log4j before we call Torque.init() - it looks
like this:

Log log = LogFactory.getLog(this.getClass());  // initialize log4j
log.debug("Initializing Torque.");
Torque.init("Torque.properties");

All you need to ensure is that a file called "log4j.properties" resides
somewhere on your classpath.

-Peter


On Mon, 2002-06-24 at 15:12, Humberto Hernandez Torres wrote:
> Last week I posted a problem about log4j not working with Torque. I debugged
> the torque code and found that the problem is in how Torque determines if it
> needs to initialize Log4J. It looks for any appenders on any category. If it
> finds one it means it has already been initlialized. In my installation it
> finds an appender in org.apache.velocity.* and therefore (wrongly)assumes it
> doesn't have to configure the log4j properties for Torque. I would imagine
> that it should only look for categories under "org.apache.torque" and not
> every single category.
> 
> --
>   Humberto
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-torque-dev-help@jakarta.apache.org>
> 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic