JJZolx;210411 Wrote: 
> 
> I'm not sure I quite understand how you can have an outside process
> rotating the logs of your application.  For instance, if the
> application buffers log writes (say every minute, or every 20 events,
> or every 32kB, etc.) how do you make sure that all entries have been
> flushed (to the correct log by time period) before the log is rotated?

On Unix it's not very difficult:

1) mv logfile  logfile.0
note that on a unix system, any process that opened "logfile" before
this point will now hold an open handle to "logfile.0" instead.  

2) send signal (usually HUP) to logger (syslog usually, but sometimes
its the program like with apache) to close/reopen logs.

3) gzip logfile.0

The time period isn't considered precise with Unix systems... since
logrotate is usually one process that handles rotation of several
programs, relying on it to rotate at precisely 06:30 for each of them
is impossible.  (Especially since stock Unix makes no attempt at being
"real time").  Log rotation typically happens once/day (or week, month,
depending on the growth of the file) and is scheduled with cron.


-- 
snarlydwarf
------------------------------------------------------------------------
snarlydwarf's Profile: http://forums.slimdevices.com/member.php?userid=1179
View this thread: http://forums.slimdevices.com/showthread.php?t=36304

_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/beta

Reply via email to