aboutsummaryrefslogtreecommitdiff
path: root/syslogd/backend.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-08-16 22:32:34 +0200
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-08-16 22:48:55 +0200
commit29e4fc5607ace15c0be03fab6930acfadda2610a (patch)
tree3b8c8068bc5afd0ee1e76c0277058f42f058f758 /syslogd/backend.h
parent21b88d935267503a52d12c208145ccf61562c441 (diff)
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 <david.oberhollenzer@tele2.at>
Diffstat (limited to 'syslogd/backend.h')
-rw-r--r--syslogd/backend.h24
1 files changed, 23 insertions, 1 deletions
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);