logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henry Lu <z...@umich.edu>
Subject Re: log4j and common logging
Date Wed, 17 Nov 2010 20:51:28 GMT
Thank for your replying! Here are first several lines:

log4j: Trying to find [log4j.xml] using context classloader 
EnvironmentClassLoader[web-app:http://localhost:8080].
log4j: Trying to find [log4j.xml] using 
sun.misc.Launcher$AppClassLoader@11b86e7 class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader 
EnvironmentClassLoader[web-app:http://localhost:8080].
log4j: Using URL 
[file:/C:/devel/projects/mtrain_trial/build/classes/log4j.properties] 
for automatic log4j configuration.
log4j: Reading configuration from URL 
file:/C:/devel/projects/mtrain_trial/build/classes/log4j.properties
log4j: Parsing for [root] with value=[ERROR, LogFile, Console].
log4j: Level token is [ERROR].
log4j: Category root set to ERROR
log4j: Parsing appender named "LogFile".
log4j: Parsing layout options for "LogFile".
log4j: Setting property [conversionPattern] to [%d %-5p [%c{2}.%M] - %m
].
log4j: End of parsing for "LogFile".
log4j: Setting property [file] to [/var/applogs/mtrain.log].
log4j: Setting property [maxFileSize] to [5MB;].
log4j: Setting property [maxBackupIndex] to [30].
log4j: Setting property [append] to [false].
log4j: setFile called: /var/applogs/mtrain.log, false
...

In my log4j.property file, I have:

log4j.rootCategory=ERROR, LogFile, Console


log4j.category.edu.umich.med.umms.mtrain=DEBUG
log4j.logger.com.ibatis=DEBUG
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG

and I got all SQL debug info but not my app's info.

-Henry

On 11/17/2010 3:42 PM, Tim Watts wrote:
> What does running the program with -Dlog4j.debug tell you? Stderr should
> show what config file, if any, it's using.
>
>
> On Wed, 2010-11-17 at 14:36 -0500, Henry Lu wrote:
>> I tried to switch from log4j to org.apache.commons.logging.Log + log4j.
>> I my code, I have:
>>
>> import org.apache.commons.logging.Log;
>> import org.apache.commons.logging.LogFactory;
>> ...
>>
>> public class XYZ
>> {
>>      static Log log = LogFactory.getLog("Xyz");
>> ...
>> }
>>
>> and I am using the existing log4j.property file which works fine for log4j.
>>
>> There is no compile error at all.
>>
>> But when I run the program, there is no log info at all.
>> why?
>>
>> -Henry
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>

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


Mime
View raw message