You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Stephen Levinson <St...@sun.com> on 2001/10/01 21:48:52 UTC

A question on log4j:ERROR No appenders could be found

I have an application in which one class creates an object of a second
class. Each class uses log4j tracing.
I have a wrapper class that gets the category instances and reads
configuration file information.
Each class gets a category instance with its class name.

In the event that a configuration file is not found by the program, I turn
off all tracing with the call:

		cat.getRoot().setPriority(org.apache.log4j.Priority.FATAL);

This happens once when my first class begins ...
But because of the following error message I made sure the above call was
made for each class instantiation. 

So now the setPriority call is made also when the second class is
instantiated.

However, I am getting the following "error" message from the log4j system:
(and was getting it before as well!)

	log4j:ERROR No appenders could be found for category (com.foo.Bar).
	log4j:ERROR Please initialize the log4j system properly.

This is for the category of my SECOND class ... but for my FIRST class this
does not happen.

I would like the user NOT to see an error message in this event, because the
behavior is intentional and not an error.
However, tracing IS CORRECTLY turned off.... it's just the error message I
don't want to see.

Any ideas how to make this behave more elegantly????

Thanks in Advance, Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org