You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Zsolt Koppany <z....@intland.com> on 2002/12/11 11:20:00 UTC

Totaly frustrated with commons-logging

Hi,

I'm totally frustrated with commons-logging. My applications uses log4j
and now tomcat switches log4j on because of commons-logging. Because I
do have to debug, I get a lot of absolutely unusable logs. The first log
of my application comes after 18000 lines of logging information.
Somebody might find that very cool I just find it terrible. I have read
the manual of commons-logging. I read about enterprise logging (find it
cool) but could not figure out how for example I could use the jdk-1.4
logging.
I really hate that commons-logging changes log4j that I get this huge
amount of unusable debug information.
How can I disable that?

Unfortunately it is not more possible to configure log4j that I just
want to see the logs of package xy. I mean a log4j configuration option:

log4j.rootCategory=DEBUG, A1, A2
log4j.logger.org.apache.commons=WARN
log4j.logger.org.apache.struts=WARN
log4j.logger.xy=DEBUG


-- 
Intland GmbH www.intland.com
Schulze-Delitzsch-Str. 16
70565 Stuttgart
Tel: +49-711-7221873 Fax: +49-1212-5168-29527


Re: Totaly frustrated with commons-logging

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Zsolt Koppany <z....@intland.com> writes:

>Unfortunately it is not more possible to configure log4j that I just
>want to see the logs of package xy. I mean a log4j configuration option:

>log4j.rootCategory=DEBUG, A1, A2
>log4j.logger.org.apache.commons=WARN
>log4j.logger.org.apache.struts=WARN
>log4j.logger.xy=DEBUG

of course it is (log4j 1.2.x, x >= 6)

--- cut ---
# Log only WARN and beyond
log4j.rootLogger = WARN, application 

# For Package foo log DEBUG
log4j.category.foo = DEBUG, application
log4j.additivity.foo = false

log4j.appender.application = org.apache.log4j.FileAppender
log4j.appender.application.file = <my log file>
log4j.appender.application.layout = org.apache.log4j.PatternLayout
log4j.appender.application.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.application.append = false
--- cut ---

this will get you WARN messages from all your classes and DEBUG messages
from the foo package.

You might want to read the log4j docs (which suck :-) ). Commons
Logging doesn't need much (none at all) configuration.

	Regards
		Henning


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20