[exim-dev] [Bug 486] Monthly datestamped log files

Top Page
Delete this message
Reply to this message
Author: Ted Cooper
Date:  
To: exim-dev
Subject: [exim-dev] [Bug 486] Monthly datestamped log files
------- You are receiving this mail because: -------
You are the QA contact for the bug.

http://bugs.exim.org/show_bug.cgi?id=486




--- Comment #6 from Ted Cooper <eximX0902w@???> 2009-03-08 22:23:39 ---
Docs look good.

>> tod_stamp(int type) function in tod.c needs to be updated to include a monthly
>> todstamp as calling a monthly log file yyyymmDD is questionable. The DD part is
>
>That's what my patch does...


So it does sorry. Got confused up the top with the expand.c only returning one
of the types rathar than both. Completely missed the 2 different types with
different length towards the end. Still, does the variable expansion section
need to be expanded to include the new %M type return? currently the
$tod_logfile variable returns the yyyymmdd version, perhaps
$tod_logfile_monthly should return yyyymm to match.

>> As a side - most systems now come with logrotated or something similar. Is
>> log file management really something that should still be in exim?
>
>Log file name management is not something that should be in logrotated. It's
>flawed because it requires moving files that could be actively in use. Writing
>to the current file works much better, but the per-day option creates too many
>files for me. These are then easily compressed after the end of the month.


You can move/rename an open file without incident on most *nix. Open files are
based off the file inode, not the name of the file. So if you move rename (into
the same file system) the log file, all existing log messages will get written
to the old file and since Exim checks the file every time it attempts to write
a log entry, any new log messages will end up in the new file. It doesn't even
need a SIGHUP like most daemons do to swap the log files. I've been dealing
with it this way for years without incident, I'm pretty sure a few other must
also be the same.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email