tomcat-users mailing list archives

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


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)
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/ 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 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 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.freemarker.cache=INFO 
> # 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.fuse=DEBUG 

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
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message