Hi everyone,

I have currently configured magnolia's logs (magnolia-debug.log,
magnolia-error.log and magnolia-activation.log) so that when it reaches a size
of 1MB it rotates starting a new log file. In WEB-INF/config/default/log4j.xml
I have the following lines for magnolia-error.log for example:

<appender name="sync-log-error" class="org.apache.log4j.RollingFileAppender">
   <param name="File" value="${magnolia.author.root}logs/magnolia-error.log" />
   <param name="MaxFileSize" value="1MB" />
   <param name="Threshold" value="ERROR" />
   <param name="MaxBackupIndex" value="5" />
   <param name="Append" value="true" />
   <layout class="org.apache.log4j.PatternLayout">
     <param name="ConversionPattern" value="%-5p  %c %d{dd.MM.yyyy HH:mm:ss} --
%m%n" />
   </layout>
</appender>

I want to change that now so that the file rotates every day, I'm not that
experienced with tomcat but I read that I had to set the RollingStyle property
to date and set a DatePattern property for this to work so I did something like
this for magnolia-debug.log:

<appender name="sync-log-debug" class="org.apache.log4j.RollingFileAppender">
   <param name="File" value="${magnolia.author.root}logs/magnolia-debug.log" />
   <param name="RollingStyle" value="date" />
   <param name="DatePattern" value="dd.MM.yyyy" />
   <param name="MaxFileSize" value="1MB" />
   <param name="Threshold" value="DEBUG" />
   <param name="MaxBackupIndex" value="5" />
   <param name="Append" value="true" />
   <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%-5p  %c %d{dd.MM.yyyy HH:mm:ss} --
%m%n" />
   </layout>
</appender>

But it's not working, has anybody done this before? am I on the right track on
this one? By the way, can catalina.out be rotated on a daily basis too? right
now I'm rotating it with logrotate in linux but I read somewhere that it's not
a safe option.

Thanks for your help

Jorge

--


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to