[PATCH] syslogd: support external logrotate command
Laurent Bercot
ska-dietlibc at skarnet.org
Wed Jul 2 18:50:59 UTC 2014
On 02/07/2014 19:24, Joshua Judson Rosen wrote:
> I don't really have any postprocessing I want to do, I just want
> to rotate my logfiles with different limits e.g.: 100 generations of
> the log that records only messages at LOG_NOTICE and higher
> vs. 10 generations of the log that records LOG_DEBUG and higher.
To do that by taking advantage of the svlogd mechanism, you'd set up
filters on the log priority (or whatever it's called these days) and
log lines into separate log directories, with different rotation
policies.
You can get the full log by concatenating all your different log
files and sorting the result - provided your timestamps are in a
format where chronological order is alphabetical order, which is true
for the YYYY-MM-DDThh:mm:ss.... format.
If you need to have all your logs in the same file and to sort them
at rotation time, then yes, it's more complex and you need to write a
suitable processor script.
--
Laurent
More information about the busybox
mailing list