2
votes

I have a webapp in tomcat for which I wish to set the log level to debug. I am not using JULI but log4j for the webapp. I have log4j-1.2.15.jar in the WEB-INF/lib folder and below is the log4j.properties file under WEB-INF/classes folder.

    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.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

and in the class files I get the handle like this...

    public static Log log = LogFactory.getLog(Crossword.class);

Where Crossword is a class in the webapp. I can see the INFO level logs being logged to muse.log in the tmp directory, now what changes do I need to make for it to log at DEBUG level. Thank you.

1

1 Answers

3
votes

Change INFO to DEBUG for the package or class you want, or for the rootCategory if you want DEBUG everywhere.

Read the documentation.