- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I want to modify the log4j.xml so that a new catalina.out is generated at 12.00 AM .
My existing log4j.xml has the following
<appender name="FILE" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${catalina.base}/logs/catalina.out"/>
<param name="Append" value="true"/>
<param name="immediateFlush" value="true"/>
After the above lines I want to add the following
<rollingPolicy class="TimeBasedRollingPolicy">
<param name="FileNamePattern" value="${catalina.base}/logs/catalina_%d.out"/>
</rollingPolicy>
(https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=logug&docsetTarget=p1agg6...)
I am not sure if the value of FileNamePattern parameter is correct.
Can anybody advise?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You could use the Linux built-in log rotation facility to do this rather than trying to modify the configuration of tomcat.
https://linux.die.net/man/8/logrotate
Greg Wootton | Principal Systems Technical Support Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You could use the Linux built-in log rotation facility to do this rather than trying to modify the configuration of tomcat.
https://linux.die.net/man/8/logrotate
Greg Wootton | Principal Systems Technical Support Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks once again.
I have implemented the logrotate on this file with weekly rotation. It works