I guess I wasn't clear on what we're doing, we're using Log4J, just not
log4j.properties.
We have a a webapp, and in the web.xml we configure a Log4jInitServlet to run
when the app starts up. This servlet reads in our own custom log4j config file
(we have all our configs in environment dependent xml...it's just the way it's
done here), create a Properties class with the settings, and then setup log4j
"manually" using PropertyConfigurator.configure(props);
Because there is no log4j file, I didn't know how we could have log4j get
initialized properly when Commons Logging is the one that creates it.
Jörg's idea works well, I created my own Log implementation, that just calls
our already-initialized-in-our-own-crazy-way Log4j.
Thanks for the help,
Jesse
----- Original Message ----
From: Jörg Schaible <[EMAIL PROTECTED]>
To: Jakarta Commons Users List <[email protected]>
Sent: Thursday, September 21, 2006 6:39:36 AM
Subject: RE: settings log4j settings programmatically
Dennis Lundberg wrote on Wednesday, September 20, 2006 10:30 PM:
> Jesse Vitrone wrote:
>> Well, I guess the issue is that when we use log4j, we
> manually configure it, but when Commons uses log4j, it hasn't
> been manually configured by us, so I was wondering if there
> was a way for Commons Logging to pass our manual configs on
> to Log4j when Commons initializes it.
>
> No, I'm afraid not. Commons logging has its own configuration, but it
> does not try to pass any configuration on to the underlying logging
> implementation (log4j in your case).
>
>> I'm going to look into the wrapper like Jörg suggested. Any other
>> ideas?
>
> Jörg's idea is the way to go if you want to make changes in commons
> logging. But I still think it would be a better solution to make your
> current configuration reader/handler work seamlessly with
> log4j. If you
> can manage that then commons logging will just work.
I had the impression that Jesse's using an own logging implementation reading
the Log4J configuration. He did not say, that he just utilized Log4J. In that
case he might simply configure JCL to use Log4J. I have no idea what he really
meant with "we manually configure it". It might probably enough to reset the
LogFactory after this manual configuration, so JCL will grap a new logger.
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]