Hi !
I have this code source :
public class TestLogging
{
Logger mLoggerRoot = Logger.getRootLogger();
Logger mClassLogger = Logger.getLogger(TestLogging.class.getName());
Logger mClassLoggerSoon =
Logger.getLogger(TestLogging.class.getName() + .soon);
public void
Your hierarchy looks like this:
root
|-- TestLogging
|-- soon
Messages logged against soon will be level-tested as follows:
1) The level explicitly set on the soon node, if one;
2) If none, the level explicitly set on the TestLogging node, if one;
3) If none, the level explicitly set
Thank you for your answer which is perfectly clear.
Now I understand the stupidity of my question : i hadn't understand the
basis of the logger's level in a hierarchy !
Steve Ebersole wrote:
Your hierarchy looks like this:
root
|-- TestLogging
|-- soon
Messages logged
Well, I seem to have really hit a brick wall on this one. I turned
log4j.debug on and got:
log4j: Trying to find [log4j.properties] using
[EMAIL PROTECTED] class loader.
log4j: Trying to find [log4j.properties] using
ClassLoader.getSystemResource().
log4j: Could not find resource:
The problem is that it is using the java jvm class-loader [using
[EMAIL PROTECTED]
There is a class either in your system or server class-path attempting to
initialize log4j prior to your Struts stuff. Once in a web-app or
enterprise-app, the class loader would be something named
Bummer. I think I'm in trouble, then. The app is going to be running on a
common server with several other apps that use log4j. In fact, our
company's common error handling component is based on log4j. I'm going to
have to do some work with our server guys on this one. Thanks for your
help.
You can take a look at the RespoistorySelector stuff that is part of log4j.
It is meant to address these kind of scenarios in server deployments. A
thread or JNDI based implementation of a RepositorySelector may help you
solve this issue
-Original Message-
From: Crumbo, Brian
At 07:50 AM 8/4/2003 -0500, you wrote:
You pretty much have two options...
1) Seek out all libraries using either log4j/commons-logging and moving them
from the server class-path to the appropriate app-specific directory.
2) Place your log4j.properties file also in the system/server class-path.