diff --git a/man/sysklogd.8 b/man/sysklogd.8 index 65f8714..b60330f 100644 --- a/man/sysklogd.8 +++ b/man/sysklogd.8 @@ -111,7 +111,12 @@ described by the people from OpenBSD at .BI "\-b " "size" This option controls the max size of files in the built-in log-rotation. When present on the command line it activates log rotation of all files -with the given maximum size. Default: disabled (0). +with the given maximum size. It is also possible to control log rotate +per log file, see +.BR syslog.conf (5) +for details. + +Default: disabled (0). .TP .BI "\-c " "count" This option controls the max number of files kept by the built-in @@ -119,7 +124,12 @@ log-rotation. To activate the built-in log rotation this option must be combined with the .BI "\-b" option. The number of files kept include both gzipped files and the -first rotated (not zipped) file. Default: 5. +first rotated (not zipped) file. It is also possible to control log +rotate per log file, see +.BR syslog.conf (5) +for details. + +Default: 5. .TP .B "\-d" Turns on debug mode. Using this the daemon will not proceed a diff --git a/man/syslog.conf.5 b/man/syslog.conf.5 index 4327a17..96f6758 100644 --- a/man/syslog.conf.5 +++ b/man/syslog.conf.5 @@ -30,13 +30,20 @@ for logging. For special features see the .BR sysklogd (8) manpage. -Every rule consists of two fields, a +Every rule consists of two fields, a .I selector -field and an -.I action -field. These two fields are separated by one or more spaces or -tabs. The selector field specifies a pattern of facilities and -priorities belonging to the specified action. +field an +.I action +and an optional +.I logrotate +field. The fields are separated by one or more spaces or tabs. The +selector field specifies a pattern of facilities and priorities +belonging to the specified action. The action details where or what to +do with the selected input. The optional logrotate field is only for +files and details the max SIZE:COUNT a file can reach before it is +rotated, and later compressed. The log rotated feature is mostly +intended for embedded systems that do not want to have cron and a +separate log rotate daemon. Lines starting with a hash mark (``#'') and empty lines are ignored. @@ -326,6 +333,19 @@ and store them in the file # *.=info;*.=notice;\\ mail.none /var/log/messages +.fi +.LP +The following is almost the same but will also log rotate and compress +aged out messages. Notice the leading '-' to ensure the file is flushed +to disk after each message. + +.IP +.nf +# Log all messages, including kernel, to messages file +# rotated every 100 kiB and keep up to 10 aged out and +# compressed files. +*.*;kern,kern.none -/log/messages 1048576:10 + .fi .LP This lets the