Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: dev

[Bug 486] Monthly datestamped log files

 

 

exim dev RSS feed   Index | Next | Previous | View Threaded


bugzilla.exim.simon at arlott

Mar 8, 2009, 4:55 AM

Post #1 of 5 (882 views)
Permalink
[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 #2 from Simon Arlott <bugzilla.exim.simon[at]arlott.org> 2009-03-08 11:55:13 ---
Created an attachment (id=302)
--> (http://bugs.exim.org/attachment.cgi?id=302)
Patch implementing an option for monthly datestamped log files

This patch based on 4.69 adds a %M equivalent to %D. It still only allows one
of these to be specified, although without changes to panic filename handling
it wouldn't be possible to use "%M/%D" anyway. (But there appears to be no
request for this feature).

For removal from the panic filename, as well as the offset, the length is now
also stored. The type is stored to allow the change in datestamp value to be
detected for mainlog/rejectlog.

Tested with %D, %M, %D%M, normal (queue run) and panic log entries.


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

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##


eximX0902w at linuxwan

Mar 8, 2009, 5:55 AM

Post #2 of 5 (850 views)
Permalink
[Bug 486] Monthly datestamped log files [In reply to]

------- You are receiving this mail because: -------
You are the QA contact for the bug.

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




--- Comment #3 from Ted Cooper <eximX0902w[at]linuxwan.net> 2009-03-08 12:55:58 ---
Should only allow for %M or %D, not both.

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
irrelevant. line 1543 in src/expand.c - case vtype_todlf needs to be duplicated
with a new type to correctly deal with tod_stamp calls.

Documentation needs updating.

Perhaps instead it should allow for the full strftime so log files can be named
whatever people want them to be rather than limiting to only 2 of the formats.

To quote the docs on panic "The location of the panic log is also determined by
log_file_path, but it is not datestamped, because rotation of the panic log
does not make sense".


As a side - most systems now come with logrotated or something similar. Is log
file management really something that should still be in exim?


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

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##


bugzilla.exim.simon at arlott

Mar 8, 2009, 6:28 AM

Post #3 of 5 (846 views)
Permalink
[Bug 486] Monthly datestamped log files [In reply to]

------- You are receiving this mail because: -------
You are the QA contact for the bug.

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

Simon Arlott <bugzilla.exim.simon[at]arlott.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |bugzilla.exim.simon[at]arlott.o
| |rg




--- Comment #4 from Simon Arlott <bugzilla.exim.simon[at]arlott.org> 2009-03-08 13:28:15 ---
(In reply to comment #3)
> Should only allow for %M or %D, not both.

It doesn't allow both; I tested it with both to see what would happen.

> 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...

> irrelevant. line 1543 in src/expand.c - case vtype_todlf needs to be duplicated
> with a new type to correctly deal with tod_stamp calls.

The documentation explicitly states that this uses %D, I don't think there's a
need to add a %M version.

> Documentation needs updating.

Ok.

> Perhaps instead it should allow for the full strftime so log files can be named
> whatever people want them to be rather than limiting to only 2 of the formats.

I could have a look at doing that as exim already uses strftime for tod_bsdin
(for some reason tod_log_datestamp doesn't use it). This would make automatic
renaming of the panic log much more difficult (perhaps impossible) and really
complicate the meaning tod_logfile and the existing usage of %D.

An extra format for monthly logs is all I need; no one has requested fully
flexible strftime naming.

> To quote the docs on panic "The location of the panic log is also determined by
> log_file_path, but it is not datestamped, because rotation of the panic log
> does not make sense".

This behaviour is kept.

> 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.


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

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##


bugzilla.exim.simon at arlott

Mar 8, 2009, 6:48 AM

Post #4 of 5 (848 views)
Permalink
[Bug 486] Monthly datestamped log files [In reply to]

------- You are receiving this mail because: -------
You are the QA contact for the bug.

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




--- Comment #5 from Simon Arlott <bugzilla.exim.simon[at]arlott.org> 2009-03-08 13:48:44 ---
Created an attachment (id=303)
--> (http://bugs.exim.org/attachment.cgi?id=303)
Documentation updates for addition of %M to log_file_path

This patch is against 4.69


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

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##


eximX0902w at linuxwan

Mar 8, 2009, 3:23 PM

Post #5 of 5 (842 views)
Permalink
[Bug 486] Monthly datestamped log files [In reply to]

------- 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[at]linuxwan.net> 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

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##

exim dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.