On Oct 4, 2006, at 12:07 PM, Swaminathan Subramanian wrote:

> Hi!
> I upgraded from Resin 2.1 to Resin 3.0.21. The web
> application uses log4j to log messages. When I moved
> the code over, I changed the resin.conf file to
> include "fine" level logging. But, I am not seeing any
> application level log messages. Moreover, I have two
> web applications and I need to log these separately. I
> tried to add logging under each web application. The
> log files got created but again there were no
> application level messages. Am I missing something?

Someone else might need to answer about log4j.

For Resin's configuration, there was a bug/confusion introduced in  
3.0.21.  You'll probably need to have two separate configuration  
items: a <log> and a <logger>.  The <log> is equivalent to a  
java.util.logging.Handler.  The logger is equivalent to  
java.util.logging.Logger.  With 3.0.21, the level doesn't  
automatically configure the logger's level (this is a mistake.)

So you might need something like:

<resin xmlns="...">
   <log name="" level="finer" path="log/debug.log" timestamp="[%H:%M:% 
S.%s] "/>
   <logger name="" level="info"/>
   <logger name="com.foo.mypackage" level="finer"/>

You can have different logging levels in each web-app.  Just add the  
<logger> with the appropriate level in each one.

<web-app xmlns="...">
   <logger name="com.foo.mypackage" level="finer"/>


<web-app xmlns="..."
   <logger name="com.foo.otherpackage" level="finest"/>

(The whole environment/logging level is tricky internally, so if you  
don't see appropriate behavior when setting the level in a resin- 
web.xml it is possible there would be a Resin bug.)

You can test the logging with the following jsp

<%@ page import="java.util.logging.*" %>
Logger log = Logger.getLogger("com.foo.mypackage.Test");
log.info("info-level test");
log.fine("fine-level test");
log.warning("warning-level test");

-- Scott

> Thanks in advance!
> SS
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest

resin-interest mailing list

Reply via email to