Search the web
Sign In
New User? Sign Up
otug_java_sig · The OTUG Java SIG of the Twin Cities
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Log4j with Apache Tomcat 6   Message List  
Reply | Forward Message #613 of 636 |
Hi,

I have a peculiar problem with Log4j. We are deploying on Weblogic 10 using log4j.xml. that works fine. We figured a way to run Tomcat 6 in such a way that we can develop on this platform and deploy on Weblogic 10.

I have figured out how to make log4j.properties work with Tomcat 6 with additional jars that use JULI logging mechanism in Tomcat 6. Unfortunately, log4j.xml (that is working with Weblogic) fails to work with Tomcat 6. So I am forced to use log4j.properties.

I have not been able to figure out how to indicate application class hierarchies in log4j.properties. So my question is how does on convert the following log4j.xml entries to log4j.properties

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<appender name="vccashib" class="org.apache.log4j.DailyRollingFileAppender">
   
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
   
<param name="File" value="vccashib_10.log"/>
   
<layout class="org.apache.log4j.PatternLayout">
       
<param name="ConversionPattern" value="%d{ISO8601} %t %-5p %c - %m%n"/>
   
</layout>
 
</appender>

 
<logger name="org.hibernate">
   
<level value="DEBUG"/>
   
<appender-ref ref="vccashib" />
 
</logger>

</log4j:configuration>

So let us say I was to write a logger that captures logs for classes in my com.abc.xyz hierarchy, how do I indicate that in log4j.properties? (I have taken care of a other values, such as type of appenders, DatePattern, ConversionPattern, FileName, layout etc.

Please note, I have sent you the only problem-specific code.

Alternatively, if you know the answer on how to make log4j.xml that is part of my war archive with Tomcat 6 (JULI jars are in place and work well with log4j.properties), please let me know

Please help.

Suhaas






Fri Apr 24, 2009 6:05 pm

suhasw1
Offline Offline
Send Email Send Email

Forward
Message #613 of 636 |
Expand Messages Author Sort by Date

Hi, I have a peculiar problem with Log4j. We are deploying on Weblogic 10 using log4j.xml. that works fine. We figured a way to run Tomcat 6 in such a way that...
Suhas Walanjoo
suhasw1
Offline Send Email
Apr 24, 2009
6:06 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help