@@ -91,6 +91,7 @@ ACTION := /path/to/file
9191OPTION := [OPTION,]
9292 |= RFC3164
9393 |= RFC5424
94+ |= pri
9495 |= iface=IFNAME
9596 |= rotate=ROT
9697 |= ttl=1..255
@@ -204,8 +205,8 @@ specified action. The
204205details where or what to do with the selected input. The
205206.Em option
206207field, which must start with the semi-colon option delimiter (';'),
207- currently supports log formatting, log rotation, outbound interface and
208- TTL when forwarding to a multicast group.
208+ currently supports priority, log formatting, log rotation, outbound
209+ interface and TTL when forwarding to a multicast group.
209210.Pp
210211The default log format is the traditional RFC3164 (included here for
211212completeness),
@@ -225,6 +226,22 @@ it is only the default for remote targets for compatibility reasons.
225226.Li 2003-08-24T05:14:15.000003-07:00 192.0.2.1 myproc 8710 - - Kilroy was here.
226227.El
227228.Pp
229+ By default,
230+ .Nm sysklogd
231+ does not print the priority of a message. However, it will if
232+ .Sy pri
233+ is added to the options. Printing the priority adds the priority in
234+ angled brackets to the message header in accordance with the RFC
235+ standard in use. Below is an example using the user-level facility and a
236+ warning severity.
237+ .Pp
238+ .Bl -tag -compact -width " RFC3164:"
239+ .It Sy RFC3164:
240+ .Li <12> Aug 24 05:14:15 192.0.2.1 myproc[8710]: Kilroy was here.
241+ .It Sy RFC5424:
242+ .Li <12>1 2003-08-24T05:14:15.000003-07:00 192.0.2.1 myproc 8710 - - Kilroy was here.
243+ .El
244+ .Pp
228245The log rotation, which is only relevant for files, details the max
229246.Ar SIZE:COUNT
230247a file can reach before it is rotated, and later compressed. This
@@ -901,6 +918,20 @@ command line option,
901918#
902919*.*;kern.none -/var/log/messages ;rotate=100k:10
903920.Ed
921+ .Ss Priority
922+ The first example logs user messages to the file
923+ .Pa /var/log/messages
924+ with syncing and prints the priority for each message. The second
925+ example logs syslog messages to the file
926+ .Pa /var/log/syslog
927+ without syncing and with the rotation from the above example, on top of
928+ printing the priority for each message.
929+ .Bd -literal -offset indent
930+ # Turn on priority printing for each user and syslog message.
931+ #
932+ user.* /var/log/messages ;pri
933+ syslog.* -/var/log/syslog ;rotate=100k:10,pri
934+ .Ed
904935.Ss Logging to Remote Syslog Server
905936These rules redirect all messages to remote hosts. The first is to
906937.Ql finlandia ,
0 commit comments