tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Problem with log level in tomcat.
Date Sat, 02 Mar 2013 14:31:35 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Vihari,

On 3/1/13 2:15 AM, Vihari Piratla wrote:
> I did perform any of the steps that I am supposed if I got to use
> log4j

Do you mean that you *did* configure Tomcat for log4j, or that you
didn't? If you did, what does the Tomcat (global) log4j.properties
file look like? The one you posted was clearly intended to be used
only with your web application.

Okay, let's start over again. I *think* this is your environment:

1. Tomcat configured to use log4j
2. Your webapp is written to use Apache commons-logging
2. Your webapp configured to use log4j
3. Your webapp's log4j sends everything to the ConsoleLogger (stdout)

#1 above implies that modifying Tomcat's conf/logging.properties file
will not affect anything.

> but it still create muse(name of my web-app).log in /tmp directory 
> with a message like this in catalina.out:
> 
> 01 Mar 12:28 Log4JUtils INFO  - Log messages will be recorded in 
> /tmp/tomcat7-tomcat7-tmp/muse.log

Is Log4JUtils a class of yours? How does it know the path to the log file?

> True that I am using log4j not juli in the webapp. This is how I am
> getting the handle in the class files. public static Log log =
> LogFactory.getLog(Crossword.class);

So you are using commons-logging in your code. Have you provided any
special configuration to commons-logging, or are you allowing it to
auto-detect that log4j is your real logging mechanism?

> This is the log4j.properties file in the WEBINF/classes folder of
> the webapp. I tried few things like appending the line
> log4j.logger=debug with no avail.

I think you meant log4j.debug=true, and that might have to be a system
property. Try setting it in log4j.properties to see what happens.

> # For the general syntax of property based configuration files see
> the # documentation of org.apache.log4j.PropertyConfigurator.
> 
> # The root category uses the appender called A1. Since no priority
> is # specified, the root category assumes the default priority for
> root # which is DEBUG in log4j. The root category is the only
> category that # has a default priority. All other categories need
> not be assigned a # priority in which case they inherit their
> priority from the # hierarchy.
> 
> log4j.rootCategory=INFO, Console
> 
> log4j.logger.com.opensymphony.xwork2=INFO 
> log4j.logger.freemarker.cache=INFO 
> log4j.logger.org.apache.struts2=INFO 
> log4j.logger.org.apache.xml.security=INFO 
> log4j.logger.org.apache.commons.httpclient=INFO 
> log4j.logger.org.mortbay.log=INFO log4j.logger.net.sf.ehcache=OFF
> 
> 
> #log4j.logger.com.hp.hpl.jena.tdb.base.block.BlockMgrMapped=ERROR,
> ROOT
> 
> # A1 is set to be a LF5Appender which outputs to a swing # logging
> console.
> 
> # this is now done programmatically in JSPHelper #
> log4j.appender.ROOT=org.apache.log4j.RollingFileAppender #
> log4j.appender.ROOT.encoding=UTF-8 #
> log4j.appender.ROOT.MaxFileSize=5000KB #
> log4j.appender.ROOT.File=muse.log # Keep old files around #
> log4j.appender.ROOT.MaxBackupIndex=2 #
> log4j.appender.ROOT.layout=org.apache.log4j.PatternLayout #
> log4j.appender.ROOT.layout.ConversionPattern=%d{dd MMM HH:mm} %c{1}
> %-5p - %m%n
> 
> log4j.appender.Console=org.apache.log4j.ConsoleAppender 
> log4j.appender.Console.encoding=UTF-8 
> log4j.appender.Console.layout=org.apache.log4j.PatternLayout 
> log4j.appender.Console.layout.ConversionPattern=%d{dd MMM HH:mm}
> %c{1} %-5p - %m%n
> 
> #log4j.logger.org.apache.jcs=ERROR 
> #log4j.logger.net.fortuna.mstor=ERROR #log4j.logger.fuse=DEBUG 
> #log4j.logger.org.hibernate.SQL=DEBUG 
> #log4j.logger.org.hibernate=DEBUG 
> #log4j.additivity.org.hibernate.SQL=false

I see no appenders configured except for the ConsoleAppender. How are
your logs ending-up in /tmp?

There is obviously a lot more to the story than what you have posted.
Can we get more?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEyDUcACgkQ9CaO5/Lv0PD2/wCguRFcazfGEZmD+LQtahSnqe4D
kxUAn3HWQiK+CU4+RmbZceZR83cL4dyA
=YAII
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message