DailyRollingFileAppender and path

D

David

Ok, I have DailyRollingFileAppender working, but I am surprised that
it is writing to root (or C:\ on windows). I have it configured this
way:

<appender name="SyslogInfoLogFile"
class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/info.log"/>
<param name="Append" value="true"/>
<param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss} %-5p
%c{2} - %m%n"/>
</layout>
</appender>

But my RollingFileAppender configured with the exact File parameter
writes to the correct directory of
jakarta-tomcat-3.3.1a\work\DEFAULT\ROOT.

I am working in a mixed environment (win/*nix) and dont' want to
hardcode the path. Can someone tell me why the
DailyRollingFileAppender doesn't write the same way as
RollingFileAppender, and how to force that?

Thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,049
Members
48,769
Latest member
Clifft

Latest Threads

Top