Commit | Line | Data |
---|---|---|
285868f0 | 1 | .TH SYSLOG 8 |
bff69eb1 | 2 | .\" @(#)syslog.8 4.2 %G% |
285868f0 EA |
3 | .SH NAME |
4 | syslog \- log systems messages | |
5 | .SH SYNOPSIS | |
6 | /etc/syslog [ | |
7 | .BI \-m N | |
8 | ] [ | |
9 | .BI \-f name | |
3bfbd4c4 EA |
10 | ] [ |
11 | .B \-d | |
285868f0 EA |
12 | ] |
13 | .SH DESCRIPTION | |
14 | .I Syslog | |
3bfbd4c4 | 15 | reads a datagram socket |
285868f0 EA |
16 | and logs each line it reads into a set of files |
17 | described by the configuration file | |
18 | /etc/syslog.conf. | |
19 | .I Syslog | |
20 | configures when it starts up | |
21 | and whenever it receives a hangup signal. | |
22 | .PP | |
23 | Each message is one line. | |
24 | A message can contain a priority code, | |
25 | marked by a digit in angle braces | |
26 | at the beginning of the line. | |
bff69eb1 EA |
27 | Priorities are defined in |
28 | .RI < syslog.h >, | |
29 | as follows: | |
285868f0 EA |
30 | .IP LOG_ALERT \w'LOG_WARNING'u+2n |
31 | this priority should essentially never | |
32 | be used. It applies only to messages that | |
33 | are so important that every user should be | |
34 | aware of them, e.g., a serious hardware failure. | |
35 | .IP LOG_SALERT | |
36 | messages of this priority should be | |
37 | issued only when immediate attention is needed | |
38 | by a qualified system person, e.g., when some | |
39 | valuable system resource dissappears. They get | |
40 | sent to a list of system people. | |
41 | .IP LOG_EMERG | |
42 | Emergency messages are not sent to users, | |
43 | but represent major conditions. An example | |
44 | might be hard disk failures. These could be | |
45 | logged in a separate file so that critical | |
46 | conditions could be easily scanned. | |
47 | .IP LOG_ERR | |
48 | these represent error conditions, such as soft | |
49 | disk failures, etc. | |
50 | .IP LOG_CRIT | |
51 | such messages contain critical information, | |
52 | but which can not be classed as errors, for example, | |
bff69eb1 | 53 | `su' attempts. |
285868f0 EA |
54 | Messages of this priority and higher |
55 | are typically logged on the system console. | |
56 | .IP LOG_WARNING | |
57 | issued when an abnormal condition has been | |
58 | detected, but recovery can take place. | |
59 | .IP LOG_NOTICE | |
60 | something that falls in the class of | |
bff69eb1 | 61 | ``important information''; this class is informational |
285868f0 EA |
62 | but important enough that you don't want to throw |
63 | it away casually. | |
64 | Messages without any priority assigned to them | |
65 | are typically mapped into this priority. | |
66 | .IP LOG_INFO | |
67 | information level messages. These messages | |
68 | could be thrown away without problems, but should | |
69 | be included if you want to keep a close watch on | |
70 | your system. | |
71 | .IP LOG_DEBUG | |
72 | it may be useful to log certain debugging | |
73 | information. Normally this will be thrown away. | |
74 | .PP | |
75 | It is expected that the kernel will not log anything below | |
76 | LOG_ERR priority. | |
77 | .PP | |
78 | The configuration file is in two sections | |
3bfbd4c4 | 79 | separated by a blank line. |
285868f0 EA |
80 | The first section defines files that |
81 | .I syslog | |
82 | will log into. | |
83 | Each line contains | |
84 | a single digit which defines the lowest priority | |
85 | (highest numbered priority) | |
86 | that this file will receive, | |
87 | an optional asterisk | |
88 | which guarantees that something gets output | |
89 | at least every 20 minutes, | |
90 | and a pathname. | |
91 | The second part of the file | |
92 | contains a list of users that will be | |
93 | informed on SALERT level messages. | |
94 | For example, the configuration file: | |
95 | .nf | |
96 | ||
bff69eb1 | 97 | 5*/dev/console |
285868f0 EA |
98 | 8/usr/spool/adm/syslog |
99 | 3/usr/adm/critical | |
100 | ||
101 | eric | |
102 | kridle | |
103 | kalash | |
104 | ||
105 | .fi | |
106 | logs all messages of priority 5 or higher | |
107 | onto the system console, | |
108 | including timing marks every 20 minutes; | |
109 | all messages of priority 8 or higher | |
110 | into the file /usr/spool/adm/syslog; | |
111 | and all messages of priority 3 or higher | |
112 | into /usr/adm/critical. | |
113 | The users ``eric'', ``kridle'', and ``kalash'' | |
114 | will be informed on any subalert messages. | |
115 | .PP | |
116 | The flags are: | |
bff69eb1 EA |
117 | .TP 0.5i |
118 | .B \-m | |
285868f0 EA |
119 | Set the mark interval to |
120 | .I N | |
121 | (default 20 minutes). | |
bff69eb1 EA |
122 | .TP |
123 | .B \-f | |
285868f0 | 124 | Specify an alternate configuration file. |
bff69eb1 EA |
125 | .TP |
126 | .B \-d | |
285868f0 EA |
127 | Turn on debugging (if compiled in). |
128 | .PP | |
129 | To bring | |
130 | .I syslog | |
131 | down, | |
132 | it should be sent a terminate signal. | |
133 | It logs that it is going down | |
134 | and then waits approximately 30 seconds | |
135 | for any additional messages to come in. | |
136 | .PP | |
137 | There are some special messages that cause control functions. | |
138 | ``<*>N'' sets the default message priority to | |
139 | .I N. | |
140 | ``<$>'' causes | |
141 | .I syslog | |
142 | to reconfigure | |
143 | (equivalent to a hangup signal). | |
144 | This can be used in a shell file run automatically | |
145 | early in the morning to truncate the log. | |
3bfbd4c4 EA |
146 | .PP |
147 | .I Syslog | |
148 | creates the file | |
149 | /etc/syslog.pid | |
150 | if possible | |
151 | containing a single line | |
152 | with its process id. | |
153 | This can be used to kill or reconfigure | |
154 | .I syslog. | |
bff69eb1 EA |
155 | .\".PP |
156 | .\".I Syslog | |
157 | .\"can also be compiled to use | |
158 | .\".IR mpx (2) | |
159 | .\"files instead of datagrams | |
160 | .\"if you are running V7. | |
161 | .\"In this case it creates and reads the file | |
162 | .\"/dev/log. | |
285868f0 EA |
163 | .SH FILES |
164 | /etc/syslog.conf \- the configuration file | |
3bfbd4c4 EA |
165 | .br |
166 | /etc/syslog.pid \- the process id | |
bff69eb1 EA |
167 | .\".br |
168 | .\"/dev/log \- under V7, the mpx file | |
285868f0 EA |
169 | .SH BUGS |
170 | LOG_ALERT and LOG_SUBALERT messages | |
171 | should only be allowed to privileged programs. | |
172 | .PP | |
173 | Actually, | |
174 | .I syslog | |
3bfbd4c4 EA |
175 | is not clever enough to deal with kernel error messages |
176 | in the current implementation. | |
285868f0 EA |
177 | .SH SEE\ ALSO |
178 | syslog(3) |