Re: problems with logging
On Tue, Jul 04, 2006 at 09:19:53AM -0400, Javier Gonzalez wrote: A possible fix is configuring the root Logger for DEBUG priority - however, this will leave all loggers logging at DEBUG level. I tried that too - still have seen no logs except logs for my application. I think it's because my application uses log4j explicitly, and libraries are using commons logging from Jakarta. May be there is something to do about using Log4J with commons logging somehow? That's weird - I have had the opposite problem, httpclient.wire logging so much info it makes my logs unreadable unless I explicitly set httpclient.wire at WARN level. Try adding this to your config: Finally i resolved this issue with adding commons-logging.jar to classpath and providing commons-logging.properties with org.apache.commons.logging.Log = org.apache.commons.logging.impl.Log4JLogger And that worked! -- Eugene N Dzhurinsky - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problems with logging
On Mon, Jul 03, 2006 at 02:18:13PM -0400, Javier Gonzalez wrote: You only have an appender attached to the root logger, and the root logger is configured to show only messages of ERROR level and higher. Right, but for org.apache.commons it is set to DEBUG. A possible fix is configuring the root Logger for DEBUG priority - however, this will leave all loggers logging at DEBUG level. I tried that too - still have seen no logs except logs for my application. I think it's because my application uses log4j explicitly, and libraries are using commons logging from Jakarta. May be there is something to do about using Log4J with commons logging somehow? -- Eugene N Dzhurinsky - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problems with logging
On 7/4/06, Eugeny N Dzhurinsky [EMAIL PROTECTED] wrote: On Mon, Jul 03, 2006 at 02:18:13PM -0400, Javier Gonzalez wrote: You only have an appender attached to the root logger, and the root logger is configured to show only messages of ERROR level and higher. Right, but for org.apache.commons it is set to DEBUG. Yes, but the logging events are relayed up the hierachy to the root logger, and the root logger is ignoring anything that isn't ERROR or higher. And since your only appender is attached to said root logger, you only get ERROR or higher messages in your logs. A possible fix is configuring the root Logger for DEBUG priority - however, this will leave all loggers logging at DEBUG level. I tried that too - still have seen no logs except logs for my application. I think it's because my application uses log4j explicitly, and libraries are using commons logging from Jakarta. May be there is something to do about using Log4J with commons logging somehow? That's weird - I have had the opposite problem, httpclient.wire logging so much info it makes my logs unreadable unless I explicitly set httpclient.wire at WARN level. Try adding this to your config: log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File= PATH TO DESIRED LOG FILE log4j.appender.file.Append=true log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d %p [%c] %m %n and modifying these lines in your config: log4j.logger.httpclient.wire=DEBUG, file log4j.logger.org.apache.commons.httpclient=DEBUG, file and monitor the specified file to see if you get debug messages from httpclient.wire -- Javier González Nicolini - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problems with logging
You only have an appender attached to the root logger, and the root logger is configured to show only messages of ERROR level and higher. A possible fix is configuring the root Logger for DEBUG priority - however, this will leave all loggers logging at DEBUG level. Another fix could be configuring a second appender that logs to a separate file, and attaching it to the loggers you are interested in monitoring at DEBUG level. On 6/30/06, Eugeny N Dzhurinsky [EMAIL PROTECTED] wrote: Hello! I have strange problem with Log4J version 1.2.13 My log4j.properties file looks like: log4j.rootLogger=ERROR, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p %d{dd/mm/yy hh:mm:ss} [%t] (%C{1}:%L) - %m%n log4j.logger.httpclient.wire=DEBUG log4j.logger.org.apache.commons.httpclient=DEBUG log4j.category.httpclient.wire=DEBUG For some reason I can see ERROR logs from my application, but I can't see DEBUG logs for package org.apache.commons.httpclient (they are using commons.logging, which is supposed to work fine with log4j). Any ideas why is that and how to enable logging in this case? -- Eugene N Dzhurinsky - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Javier González Nicolini - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]