Date: 2004-03-06T15:15:01
Editor: NoelBergman <[EMAIL PROTECTED]>
Wiki: Apache James Wiki
Page: LogRotation
URL: http://wiki.apache.org/james/LogRotation
Fixed broken {{{ }}}
Change Log:
------------------------------------------------------------------------------
@@ -11,11 +11,13 @@
For example, the current:
-{{{ <rotation type="unique" pattern="-yyyy-MM-dd" suffix=".log"> }}}
-{{{ <or> }}}
-{{{ <date>dd</date> }}}
-{{{ </or> }}}
-{{{ </rotation> }}}
+{{{
+ <rotation type="unique" pattern="-yyyy-MM-dd" suffix=".log">
+ <or>
+ <date>dd</date>
+ </or>
+ </rotation>
+}}}
rotates that log daily. Adding
@@ -33,26 +35,30 @@
if we expect to rotate more than daily. That might look something like:
-{{{ <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log"> }}}
-{{{ <or> }}}
-{{{ <date>dd</date> }}}
-{{{ <size>104857600</size> }}}
-{{{ </or> }}}
-{{{ </rotation> }}}
+{{{
+ <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
+ <or>
+ <date>dd</date>
+ <size>104857600</size>
+ </or>
+ </rotation>
+}}}
To set up logs to be prefixed with the date, such as 20030215-smtpserver.log,
the following definition can be used -
-{{{ <file id="James-target"> }}}
-{{{ <B><filename>d:/Transfer/James/logs/20</filename></B> }}}
-{{{ <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority}%{category}:
%{message}\n%{throwable}</format> }}}
-{{{ <append>true</append> }}}
-{{{ <rotation type="unique" pattern="yyMMdd"
<B>suffix="smtpserver.log"</B>> }}}
-{{{ <or> }}}
-{{{ <date>dd</date> }}}
-{{{ <size>10485760</size> }}}
-{{{ </or> }}}
-{{{ </rotation> }}}
-{{{ </file> }}}
+{{{
+ <file id="James-target">
+ <B><filename>d:/Transfer/James/logs/20</filename></B>
+ <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority}%{category}:
%{message}\n%{throwable}</format>
+ <append>true</append>
+ <rotation type="unique" pattern="yyMMdd"
<B>suffix="smtpserver.log"</B>>
+ <or>
+ <date>dd</date>
+ <size>10485760</size>
+ </or>
+ </rotation>
+ </file>
+}}}
Note the way the filename element is used and how the descriptive name is set
with the suffix attribute. The same rules governing <I>hourly</I> rotation as
described above still apply; this is just another way to represent the log file
names.