If I set the level of Log1 appender to DEBUG, then DEBUG logs of all the
classes including MyClass are getting logged. If I set it to ERROR, then
ERROR logs of all the classes including MyClass are getting logged. But what
I want is - DEBUG logs of only MyClass and ERROR of rest all. Here, my
motive is to set DEBUG level logging for most important classes helping in
debugging procedure.
<logger name="com.pkg.MyClass">
<level value="DEBUG" />
</logger>
private final static Logger logger = Logger.getLogger(MyClass.class);
This is how a logger is defined in my code. It was my mistake to replace
"com.pkg.MyClass" with "MyClass".
Thanks for "additivity" and "priority" related suggestions.
Actually, root isn't my concern here. No matter what the level of root and
appender is, I want DEBUG logs of only MyClass.
Douglas E Wegscheid wrote:
>
>> I want MyClass logs of DEBUG level and all other classes of ERROR in
>> "log1.log" file as mentioned in logger "Log1".
>> ...
>> whereas if I set the level in appender
>> "Log1" to DEBUG, I do get the DEBUG logs of Myclass in log1.log.
>
> If you set the level of the Log1 appender to DEBUG, you say that you get
> the DEBUG logs of Myclass in log1.log. Isn't that what you want?
>
--
View this message in context:
http://old.nabble.com/class-specific-logging-level-tp33974515p33982558.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]