From 29e4fc5607ace15c0be03fab6930acfadda2610a Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 16 Aug 2018 22:32:34 +0200 Subject: usyslogd: more control over log rotate behaviour, command line processing - Add more fine grained control over how log rotation is supposed to behave - Add command line option processing to usyslogd - Expose log rotation control via command line switches - Add default values to usyslogd service for pygos use case Signed-off-by: David Oberhollenzer --- syslogd/backend.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'syslogd/backend.h') diff --git a/syslogd/backend.h b/syslogd/backend.h index b5e238a..5880ee3 100644 --- a/syslogd/backend.h +++ b/syslogd/backend.h @@ -20,8 +20,30 @@ #include "proto.h" +enum { + /* + Rotate log data in a way that we still generate a continuous stream + of log data. E.g. in the case of log files, move the current log file + to one suffixed with a timestamp. We don't lose any log data. + */ + LOG_ROTATE_CONTINUOUS = 0x00, + + /* + Rotate log data by overwriting old data with more recent data. + E.g. in the case of log files, move the current log file to one + with a constant prefix, overwriting any existing data. + */ + LOG_ROTATE_OVERWRITE = 0x01, + + /* + Automatically do a log rotatation if a log stream reaches a preset + size limit. + */ + LOG_ROTATE_SIZE_LIMIT = 0x10, +}; + typedef struct log_backend_t { - int (*init)(struct log_backend_t *log); + int (*init)(struct log_backend_t *log, int flags, size_t sizelimit); void (*cleanup)(struct log_backend_t *log); -- cgit v1.2.3