syslog.conf File
Purpose
Controls output of the syslogd daemon.
Description
- A selector to determine the message priorities to which the line applies.
- An action. Each line can contain an optional part.
- Rotation.
The fields must be separated by one or more tabs or spaces.
Format
msg_src_list destination [rotate [size sizek|m] [files files] [time timeh|d|w|m|y] [compress] [archive archive]]
- facility
- all (except mark)
- priority
- is one of (from high to low):
- destination
- is:
[rotate [size sizek|m] [files files] [time timeh|d|w|m|y] [compress] [archive archive]] is:
If destination is
a regular file and the word rotate
is specified,
then the destination is limited by either size or time,
or both. The size value causes the destination to
be limited to size, with files files
kept in the rotation. The backup filenames are created by appending
a period and a number to destination, starting
with .0. The time value causes the destination to
be rotated after time. If both time and size are
specified, then logfiles will be rotated once the logfile size exceeds size or
the after time, whichever is earlier.
If the compress option is specified then the logfile names will be generated with a .Z extension. The files keyword will be applicable to the logfiles which are currently under rotation. For example, if we specify the compress option, then only file with .Z extension will be under rotation and the number of such files will be limited byfiles files. Any logfiles with an extension other than .Z will not be under the rotation scheme and thus will not be under the restriction of files files. Similarly if the compress option is removed then the files which have been generated with .Z extension will no longer be the part of rotation scheme and will not be limited by the files files.
The
minimum size that can be specified is 10k. The minimum number of files
that can be specified is 2. The default size is 1MB and the default
for files is unlimited. Therefore, if only rotate
is
specified, the log will be rotated with size =
1m. The compress option means that rotated log files that are not
in use will be compressed. The archive option will save rotated log
files that are not in use to archive.
The default is not to rotate log files.
[perm [mode]] is:
If destination is a regular file, and the word perm is specified it means that rotated files is having the permission specified by mode.
[Filter [filename]] is:
If the destination is a regular file, and word filter is specified it means that the messages coming from the remote machine is logged on to the file specified with this keyword. The default is not to filter the remote messages and not to set the permissions on rotate log files.
user.debug /var/log/syslog.out rotate size 100k files 4
user.notice /var/log/syslog.out rotate size 200k files 16
The proper configuration for the above case follows:user.debug /var/log/syslog.debug.out rotate size 100k files 4
user.notice /var/log/syslog.notice.out rotate size 200k files 16
Example
"mail messages, at debug or higher, go to Log file. File must exist."
"all facilities, at debug and higher, go to console"
"all facilities, at crit or higher, go to all users"
"user messages, at warning or higher, go to logstream"
mail.debug /usr/spool/mqueue/syslog
*.info /dev/console
*.crit *
user.warn centralizedlog CentralizedRAS/SyslogUserWarning
-or otherwise can have something like:*.debug /var/log/syslog.debug100k.out rotate size 100k files 4
*.crit /var/log/syslog.dailycrit.out rotate time 1d
Files
Item | Description |
---|---|
/etc/syslog.conf | Controls the output of syslogd. |