tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Delbecq <de...@oma.be>
Subject logging does not work in my webapp
Date Tue, 05 Sep 2006 08:46:07 GMT
Hello,
using tomcat, the logging does not work in my webapp. I am out of idea,
so if someone can suggest me something more to test to get my logs.
Here is the situation.
I followed instructions on ow to setup tomcat for log4j (that is
basically adds the commons-logging and log4j jars in common/lib)
I setup a log4j.xml file in my WEB-INF/classes/log4j.xml. I know it's
read by log4j and used by commons-logging, because when i change the
root debug level, it alters the verbosity of struts, bean utils, and so
on. Setting up a org.apache category to reduce verbosity to info only
does work too.

In my custom class i do this:

    private static Log log =
LogFactory.getLog(SharkEngineBean.class.getName()); 
/*be.dissco.shark.jsf.bean.SharkEngineBean*/

......
in a instance method of the class, i have
        log.debug("test");
        log.warn("test");
        log.error("test");
        log.fatal("test");
        System.out.println("You should see error messages above");
I should get log lines on a regular basis, ranging from debug to fatal
levels. However, i get strictly nothing. Anyone can suggest me where to
look for some reason for this to not work. (Btw, i tested,
log.isDebugEnabled() -> log.isFatalEnabled() all return true)

I deploy this and try. I get this in catalina.out
2553 [http-8080-Processor1] DEBUG
org.apache.struts.action.ActionServlet  - Scanning web.xml for
controller servlet mapping
2559 [http-8080-Processor1] DEBUG
org.apache.struts.action.ActionServlet  - Process servletName=faces,
urlPattern=*.faces
2560 [http-8080-Processor1] DEBUG
org.apache.struts.action.ActionServlet  - Process servletName=struts,
urlPattern=*.do
2560 [http-8080-Processor1] DEBUG
org.apache.struts.action.ActionServlet  - Process servletName=sharkView,
urlPattern=/processStatus.png
2560 [http-8080-Processor1] DEBUG
org.apache.struts.action.ActionServlet  - Mapping for servlet 'struts' =
'*.do'
2560 [http-8080-Processor1] DEBUG
org.apache.struts.action.ActionServlet  - Initializing module path ''
configuration from '/WEB-INF/struts-config.xml'
2746 [http-8080-Processor1] DEBUG
org.apache.struts.action.ActionServlet  - Initializing module path ''
message resources from 'shark-struts'
2746 [http-8080-Processor1] DEBUG
org.apache.struts.util.PropertyMessageResources  - Initializing,
config='shark-struts', returnNull=true
2746 [http-8080-Processor1] DEBUG
org.apache.struts.action.ActionServlet  - Initializing module path ''
data sources
2747 [http-8080-Processor1] DEBUG
org.apache.struts.action.ActionServlet  - Initializing module path ''
plug ins
You should see error messages above
You should see error messages above
You should see error messages above
You should see error messages above
You should see error messages above
You should see error messages above
You should see error messages above
You should see error messages above

As you can see, despite struts and other libs usin  commons-logging
output well, there is no output from my own class. Here is content of
log4j.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false" threshold="debug">
    <appender name="A1" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%-4r [%t] %-5p %c %x
- %m%n"/>
        </layout>
    </appender>

    <category name="org.apache.commons.digester">
        <level value="INFO"/>
    </category>
    <category name="org.apache.commons.beanutils">
        <level value="INFO"/>
    </category>
    <category name="be.dissco">
        <level value="DEBUG"/>
    </category>
    <root>
        <level value="DEBUG"/>
        <appender-ref ref="A1"/>
    </root>
</log4j:configuration>


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


Mime
View raw message