You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by kwirirai Nhakwi <kw...@designat7.co.zw> on 2003/01/25 13:11:02 UTC

Log File Rotation

 
 
Hi All
Is there a way to rotate logs generated by James ,
because having on large log file can be difficult to look at. I am
not familiar with the logging technique used in James it would help if I
can customize the logs generated by James.
thanks
kwiri
 

Re: Log File Rotation

Posted by Harmeet Bedi <ha...@kodemuse.com>.
----- Original Message ----- 
From: "Serge Knystautas" <se...@lokitech.com>
> I would +1 to changing it to rotate for the 2.1.1 release.

+1 from me too.

Harmeet


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Log File Rotation

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Reasonable default, docs and user feedback is the way to go.

See: http://nagoya.apache.org/wiki/apachewiki.cgi?James/LogRotation

	--- Noel

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Log File Rotation

Posted by Harmeet Bedi <ha...@kodemuse.com>.
----- Original Message -----
From: "Noel J. Bergman" <no...@devtech.com>
> Each log file is independently configurable.  But I'm not terribly
inclined
> to guess what custom configuration everyone will want in their logs.  We
> have to pick a default pattern and policy set, and stick with it.  If our
> users indicate some sort of broad agreement on how they typically want
logs
> rotated, we can make that the default.
>....
> I am willing to put this information into the Wiki, and into an FAQ,

Date based rotation is a good improvement  esp. when coupled with
documentation changes so +1 on that.

I would have picked size based rotation as the default as it is safer, but
you are right administrators will want to customize logging to suit
their deployment requirements and it will never be possible to satisfy all.
Reasonable default, docs and user feedback is the way to go.

Harmeet




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Log File Rotation

Posted by "Noel J. Bergman" <no...@devtech.com>.
Harmeet,

> There may be log files that rarely change. No need to rotate them daily.

Each log file is independently configurable.  But I'm not terribly inclined
to guess what custom configuration everyone will want in their logs.  We
have to pick a default pattern and policy set, and stick with it.  If our
users indicate some sort of broad agreement on how they typically want logs
rotated, we can make that the default.

> The log file size could grow without upper bound even within a day.

Anyone who wants to can reconfigure the log rotation.  Most administrators
rotate logs, if they rotate them, on a periodic basis.  The way Avalon
rotates using a date, logs can rotate hourly, daily, monthly, or yearly.
They could rotate at specific points during the day with a <time> element,
or when a size is reached with a <size> element.

For example, the current:

  <rotation type="unique" pattern="-yyyy-MM-dd" suffix=".log">
    <or>
      <date>dd</date>
    </or>
  </rotation>

rotates that log daily.  Adding

      <size>1048576</size>

would rotate at a 1MB boundary, within the day.

However, because of the way Avalon's UniqueFileStrategy class constructs the
filename, simply adding another rotation policy won't work properly if
rotation can occur more often than daily. The pattern attribute is only set
for daily rotation.  We'd need to change the pattern to be something like
"-yyyy-MM-dd-hh" to allow rotation (for whatever reason) hourly, or
"-yyyy-MM-dd-hh-mm" if the log could rotate more than once within an hour.
So instead of having a file name like:

   smtpserver-2003-01-26.log

we'd have to have:

   smtpserver-2003-01-26-18.log or smtpserver-2003-01-26-18-30.log

if we expect to rotate more than daily.

I am willing to put this information into the Wiki, and into an FAQ, for our
users to customize their logging, but I am not planning to write an entire
tutorial on Avalon log rotation.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Log File Rotation

Posted by Harmeet Bedi <ha...@kodemuse.com>.
----- Original Message -----
From: "Noel J. Bergman" <no...@devtech.com>
> Attached is a version of james-server.xml to configure James for daily
> server logs.

Good improvement but it may be better to rotate on the file size rather than
date.

2 benefits:
- There may be log files that rarely change. No need to rotate them daily.
- The log file size could grow without upper bound even within a day.

Harmeet


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Log File Rotation

Posted by Danny Angus <da...@apache.org>.
+1 for comit to HEAD Noel. I'm kind of out of the picture for 2.1 at the mo, so no comment.

> -----Original Message-----
> From: Noel J. Bergman [mailto:noel@devtech.com]
> Sent: 26 January 2003 21:09
> To: James Developers List
> Subject: RE: Log File Rotation
> 
> 
> Attached is a version of james-server.xml to configure James for daily
> server logs.  It appears to work so far.  If it works overnight, 
> and no one
> has any objections, I'll commit to the CVS, both v2.1 and HEAD.
> 
> 	--- Noel
> 
> -----Original Message-----
> From: Noel J. Bergman [mailto:noel@devtech.com]
> Sent: Sunday, January 26, 2003 14:45
> To: James Developers List
> Subject: RE: Log File Rotation
> 
> Serge,
> 
> I'll work on it ... looks like we need something like:
> 
>   <file id="default">
>     <filename> ... </filename>
>     <format> ... </format>
>     <append>true</append>
>     <rotation type="unique" pattern="yyyy-MM-dd" suffix=".log">
>       <or>
>         <date>dd</date>
>       </or>
>     </rotation>
>   </file>
> 
> That should do daily rotation.  Will experiment.  We might also need to
> change the filename to eliminate the suffix, which may from from the
> rotation tag.  Will check the code.
> 
> 	--- Noel
> 
> -----Original Message-----
> From: Serge Knystautas [mailto:sergek@lokitech.com]
> Sent: Saturday, January 25, 2003 20:20
> To: James Developers List
> Subject: Re: Log File Rotation
> 
> 
> ----- Original Message -----
> From: "Noel J. Bergman" <no...@devtech.com>
> 
> 
> > James uses Avalon's logging mechanism.  See the documentation for the
> > FileTargetFactory, and then adjust SAR-INF/environment.xml accordingly.
> >
> > ref:
> >
> http://jakarta.apache.org/avalon/excalibur/logger/api/org/apache/a
valon/exca
libur/logger/factory/FileTargetFactory.html

[switching to dev]

Shouldn't we change James log files to rotate by default so they can't grow
unchecked?  Is this logger feature available in what we're using with the
2.1 branch?  I would +1 to changing it to rotate for the 2.1.1 release.

Serge Knystautas
Lokitech
Software - Strategy - Design
http://www.lokitech.com/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Log File Rotation

Posted by "Noel J. Bergman" <no...@devtech.com>.
Attached is a version of james-server.xml to configure James for daily
server logs.  It appears to work so far.  If it works overnight, and no one
has any objections, I'll commit to the CVS, both v2.1 and HEAD.

	--- Noel

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com]
Sent: Sunday, January 26, 2003 14:45
To: James Developers List
Subject: RE: Log File Rotation

Serge,

I'll work on it ... looks like we need something like:

  <file id="default">
    <filename> ... </filename>
    <format> ... </format>
    <append>true</append>
    <rotation type="unique" pattern="yyyy-MM-dd" suffix=".log">
      <or>
        <date>dd</date>
      </or>
    </rotation>
  </file>

That should do daily rotation.  Will experiment.  We might also need to
change the filename to eliminate the suffix, which may from from the
rotation tag.  Will check the code.

	--- Noel

-----Original Message-----
From: Serge Knystautas [mailto:sergek@lokitech.com]
Sent: Saturday, January 25, 2003 20:20
To: James Developers List
Subject: Re: Log File Rotation


----- Original Message -----
From: "Noel J. Bergman" <no...@devtech.com>


> James uses Avalon's logging mechanism.  See the documentation for the
> FileTargetFactory, and then adjust SAR-INF/environment.xml accordingly.
>
> ref:
>
http://jakarta.apache.org/avalon/excalibur/logger/api/org/apache/avalon/exca
libur/logger/factory/FileTargetFactory.html

[switching to dev]

Shouldn't we change James log files to rotate by default so they can't grow
unchecked?  Is this logger feature available in what we're using with the
2.1 branch?  I would +1 to changing it to rotate for the 2.1.1 release.

Serge Knystautas
Lokitech
Software - Strategy - Design
http://www.lokitech.com/

RE: Log File Rotation

Posted by Danny Angus <da...@apache.org>.
FYI, when we had the log problem I spoke with Paul H. and messed with different log settings, I got rotaion working, but can't remeber how. :-( So it will work.

d.

> -----Original Message-----
> From: Noel J. Bergman [mailto:noel@devtech.com]
> Sent: 26 January 2003 19:45
> To: James Developers List
> Subject: RE: Log File Rotation
> 
> 
> Serge,
> 
> I'll work on it ... looks like we need something like:
> 
>   <file id="default">
>     <filename> ... </filename>
>     <format> ... </format>
>     <append>true</append>
>     <rotation type="unique" pattern="yyyy-MM-dd" suffix=".log">
>       <or>
>         <date>dd</date>
>       </or>
>     </rotation>
>   </file>
> 
> That should do daily rotation.  Will experiment.  We might also need to
> change the filename to eliminate the suffix, which may from from the
> rotation tag.  Will check the code.
> 
> 	--- Noel
> 
> -----Original Message-----
> From: Serge Knystautas [mailto:sergek@lokitech.com]
> Sent: Saturday, January 25, 2003 20:20
> To: James Developers List
> Subject: Re: Log File Rotation
> 
> 
> ----- Original Message -----
> From: "Noel J. Bergman" <no...@devtech.com>
> 
> 
> > James uses Avalon's logging mechanism.  See the documentation for the
> > FileTargetFactory, and then adjust SAR-INF/environment.xml accordingly.
> >
> > ref:
> >
> http://jakarta.apache.org/avalon/excalibur/logger/api/org/apache/a
valon/exca
libur/logger/factory/FileTargetFactory.html

[switching to dev]

Shouldn't we change James log files to rotate by default so they can't grow
unchecked?  Is this logger feature available in what we're using with the
2.1 branch?  I would +1 to changing it to rotate for the 2.1.1 release.

Serge Knystautas
Lokitech
Software - Strategy - Design
http://www.lokitech.com/



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Log File Rotation

Posted by "Noel J. Bergman" <no...@devtech.com>.
Serge,

I'll work on it ... looks like we need something like:

  <file id="default">
    <filename> ... </filename>
    <format> ... </format>
    <append>true</append>
    <rotation type="unique" pattern="yyyy-MM-dd" suffix=".log">
      <or>
        <date>dd</date>
      </or>
    </rotation>
  </file>

That should do daily rotation.  Will experiment.  We might also need to
change the filename to eliminate the suffix, which may from from the
rotation tag.  Will check the code.

	--- Noel

-----Original Message-----
From: Serge Knystautas [mailto:sergek@lokitech.com]
Sent: Saturday, January 25, 2003 20:20
To: James Developers List
Subject: Re: Log File Rotation


----- Original Message -----
From: "Noel J. Bergman" <no...@devtech.com>


> James uses Avalon's logging mechanism.  See the documentation for the
> FileTargetFactory, and then adjust SAR-INF/environment.xml accordingly.
>
> ref:
>
http://jakarta.apache.org/avalon/excalibur/logger/api/org/apache/avalon/exca
libur/logger/factory/FileTargetFactory.html

[switching to dev]

Shouldn't we change James log files to rotate by default so they can't grow
unchecked?  Is this logger feature available in what we're using with the
2.1 branch?  I would +1 to changing it to rotate for the 2.1.1 release.

Serge Knystautas
Lokitech
Software - Strategy - Design
http://www.lokitech.com/



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Log File Rotation

Posted by Serge Knystautas <se...@lokitech.com>.
----- Original Message -----
From: "Noel J. Bergman" <no...@devtech.com>


> James uses Avalon's logging mechanism.  See the documentation for the
> FileTargetFactory, and then adjust SAR-INF/environment.xml accordingly.
>
> ref:
>
http://jakarta.apache.org/avalon/excalibur/logger/api/org/apache/avalon/exca
> libur/logger/factory/FileTargetFactory.html

[switching to dev]

Shouldn't we change James log files to rotate by default so they can't grow
unchecked?  Is this logger feature available in what we're using with the
2.1 branch?  I would +1 to changing it to rotate for the 2.1.1 release.

Serge Knystautas
Lokitech
Software - Strategy - Design
http://www.lokitech.com/



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Log File Rotation

Posted by "Noel J. Bergman" <no...@devtech.com>.
Kwiri,

See http://nagoya.apache.org/wiki/apachewiki.cgi?James/LogRotation, which
discusses it.  I have also included this feature by default in the current
nightly build, v2.1.1a4.

	--- Noel

-----Original Message-----
From: kwirirai Nhakwi [mailto:kwiri@designat7.co.zw]
Sent: Monday, January 27, 2003 0:44
To: 'James Users List'
Subject: RE: Log File Rotation


Thanks for the ref ,that’s what I needed.

kwiri

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com]
Sent: Saturday, January 25, 2003 5:32 PM
To: James Users List
Subject: RE: Log File Rotation

James uses Avalon's logging mechanism.  See the documentation for the
FileTargetFactory, and then adjust SAR-INF/environment.xml accordingly.

ref:
http://jakarta.apache.org/avalon/excalibur/logger/api/org/apache/avalon/exca
libur/logger/factory/FileTargetFactory.html

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Log File Rotation

Posted by kwirirai Nhakwi <kw...@designat7.co.zw>.
Thanks for the ref ,that’s what I needed.

kwiri

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com] 
Sent: Saturday, January 25, 2003 5:32 PM
To: James Users List
Subject: RE: Log File Rotation

James uses Avalon's logging mechanism.  See the documentation for the
FileTargetFactory, and then adjust SAR-INF/environment.xml accordingly.

ref:
http://jakarta.apache.org/avalon/excalibur/logger/api/org/apache/avalon/
exca
libur/logger/factory/FileTargetFactory.html

	--- Noel


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Log File Rotation

Posted by "Noel J. Bergman" <no...@devtech.com>.
James uses Avalon's logging mechanism.  See the documentation for the
FileTargetFactory, and then adjust SAR-INF/environment.xml accordingly.

ref:
http://jakarta.apache.org/avalon/excalibur/logger/api/org/apache/avalon/exca
libur/logger/factory/FileTargetFactory.html

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>