]> git.donarmstrong.com Git - dsa-puppet.git/blob - files/etc/syslog-ng/syslog-ng.conf
Merge branch 'master' of git+ssh://zobel@puppet.debian.org/srv/puppet.debian.org...
[dsa-puppet.git] / files / etc / syslog-ng / syslog-ng.conf
1 #
2 # Configuration file for syslog-ng under Debian
3 #
4 # attempts at reproducing default syslog behavior
5
6 # the standard syslog levels are (in descending order of priority):
7 # emerg alert crit err warning notice info debug
8 # the aliases "error", "panic", and "warn" are deprecated
9 # the "none" priority found in the original syslogd configuration is
10 # only used in internal messages created by syslogd
11
12
13 ######
14 # options
15
16 options {
17         # disable the chained hostname format in logs
18         # (default is enabled)
19         chain_hostnames(0);
20
21         # the time to wait before a died connection is re-established
22         # (default is 60)
23         time_reopen(10);
24
25         # the time to wait before an idle destination file is closed
26         # (default is 60)
27         time_reap(360);
28
29         # the number of lines buffered before written to file
30         # you might want to increase this if your disk isn't catching with
31         # all the log messages you get or if you want less disk activity
32         # (say on a laptop)
33         # (default is 0)
34         #sync(0);
35
36         # the number of lines fitting in the output queue
37         log_fifo_size(2048);
38
39         # enable or disable directory creation for destination files
40         create_dirs(yes);
41
42         # default owner, group, and permissions for log files
43         # (defaults are 0, 0, 0600)
44         #owner(root);
45         group(adm);
46         perm(0640);
47
48         # default owner, group, and permissions for created directories
49         # (defaults are 0, 0, 0700)
50         #dir_owner(root);
51         #dir_group(root);
52         dir_perm(0755);
53
54         # enable or disable DNS usage
55         # syslog-ng blocks on DNS queries, so enabling DNS may lead to
56         # a Denial of Service attack
57         # (default is yes)
58         use_dns(no);
59
60         # maximum length of message in bytes
61         # this is only limited by the program listening on the /dev/log Unix
62         # socket, glibc can handle arbitrary length log messages, but -- for
63         # example -- syslogd accepts only 1024 bytes
64         # (default is 2048)
65         #log_msg_size(2048);
66
67         #Disable statistic log messages.
68         stats_freq(0);
69
70         # Some program send log messages through a private implementation.
71         # and sometimes that implementation is bad. If this happen syslog-ng
72         # may recognise the program name as hostname. Whit this option
73         # we tell the syslog-ng that if a hostname match this regexp than that
74         # is not a real hostname.
75         bad_hostname("^gconfd$");
76 };
77
78
79 ######
80 # sources
81
82 # all known message sources
83 source s_all {
84         # message generated by Syslog-NG
85         internal();
86         # standard Linux log source (this is the default place for the syslog()
87         # function to send logs to)
88         unix-stream("/dev/log");
89         # messages from the kernel
90         file("/proc/kmsg" log_prefix("kernel: "));
91         # use the following line if you want to receive remote UDP logging messages
92         # (this is equivalent to the "-r" syslogd flag)
93         # udp();
94 };
95
96
97 ######
98 # destinations
99
100 # some standard log files
101 destination df_auth { file("/var/log/auth.log"); };
102 destination df_syslog { file("/var/log/syslog"); };
103 destination df_cron { file("/var/log/cron.log"); };
104 destination df_daemon { file("/var/log/daemon.log"); };
105 destination df_kern { file("/var/log/kern.log"); };
106 destination df_lpr { file("/var/log/lpr.log"); };
107 destination df_mail { file("/var/log/mail.log" group(maillog)); };
108 destination df_mail_info { file("/var/log/mail.info" group(maillog)); };
109 destination df_mail_warn { file("/var/log/mail.warn" group(maillog)); };
110 destination df_mail_err { file("/var/log/mail.err" group(maillog)); };
111 destination df_user { file("/var/log/user.log" perm(0644)); };
112 destination df_uucp { file("/var/log/uucp.log"); };
113
114 # these files are meant for the mail system log files
115 # and provide re-usable destinations for {mail,cron,...}.info,
116 # {mail,cron,...}.notice, etc.
117 destination df_facility_dot_info { file("/var/log/$FACILITY.info"); };
118 destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); };
119 destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); };
120 destination df_facility_dot_err { file("/var/log/$FACILITY.err"); };
121 destination df_facility_dot_crit { file("/var/log/$FACILITY.crit"); };
122
123 # these files are meant for the news system, and are kept separated
124 # because they should be owned by "news" instead of "root"
125 destination df_news_dot_notice { file("/var/log/news/news.notice" owner("news")); };
126 destination df_news_dot_err { file("/var/log/news/news.err" owner("news")); };
127 destination df_news_dot_crit { file("/var/log/news/news.crit" owner("news")); };
128
129 # some more classical and useful files found in standard syslog configurations
130 destination df_debug { file("/var/log/debug"); };
131 destination df_messages { file("/var/log/messages"); };
132
133 # pipes
134 # a console to view log messages under X
135 destination dp_xconsole { pipe("/dev/xconsole"); };
136
137 # consoles
138 # this will send messages to everyone logged in
139 destination du_all { usertty("*"); };
140
141
142 ######
143 # filters
144
145 # all messages from the auth and authpriv facilities
146 filter f_auth { facility(auth, authpriv); };
147
148 # all messages except from the auth and authpriv facilities
149 filter f_syslog { not facility(auth, authpriv); };
150
151 # respectively: messages from the cron, daemon, kern, lpr, mail, news, user,
152 # and uucp facilities
153 filter f_cron { facility(cron); };
154 filter f_daemon { facility(daemon); };
155 filter f_kern { facility(kern); };
156 filter f_lpr { facility(lpr); };
157 filter f_mail { facility(mail); };
158 filter f_news { facility(news); };
159 filter f_user { facility(user); };
160 filter f_uucp { facility(uucp); };
161
162 # some filters to select messages of priority greater or equal to info, warn,
163 # and err
164 # (equivalents of syslogd's *.info, *.warn, and *.err)
165 filter f_at_least_info { level(info..emerg); };
166 filter f_at_least_notice { level(notice..emerg); };
167 filter f_at_least_warn { level(warn..emerg); };
168 filter f_at_least_err { level(err..emerg); };
169 filter f_at_least_crit { level(crit..emerg); };
170
171 # all messages of priority debug not coming from the auth, authpriv, news, and
172 # mail facilities
173 filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
174
175 # all messages of info, notice, or warn priority not coming form the auth,
176 # authpriv, cron, daemon, mail, and news facilities
177 filter f_messages {
178         level(info,notice,warn)
179             and not facility(auth,authpriv,cron,daemon,mail,news);
180 };
181
182 # messages with priority emerg
183 filter f_emerg { level(emerg); };
184
185 # complex filter for messages usually sent to the xconsole
186 filter f_xconsole {
187     facility(daemon,mail)
188         or level(debug,info,notice,warn)
189         or (facility(news)
190                 and level(crit,err,notice));
191 };
192
193
194 ######
195 # logs
196 # order matters if you use "flags(final);" to mark the end of processing in a
197 # "log" statement
198
199 # these rules provide the same behavior as the commented original syslogd rules
200
201 # auth,authpriv.*                 /var/log/auth.log
202 log {
203         source(s_all);
204         filter(f_auth);
205         destination(df_auth);
206 };
207
208 # *.*;auth,authpriv.none          -/var/log/syslog
209 log {
210         source(s_all);
211         filter(f_syslog);
212         destination(df_syslog);
213 };
214
215 # this is commented out in the default syslog.conf
216 # cron.*                         /var/log/cron.log
217 #log {
218 #        source(s_all);
219 #        filter(f_cron);
220 #        destination(df_cron);
221 #};
222
223 # daemon.*                        -/var/log/daemon.log
224 log {
225         source(s_all);
226         filter(f_daemon);
227         destination(df_daemon);
228 };
229
230 # kern.*                          -/var/log/kern.log
231 log {
232         source(s_all);
233         filter(f_kern);
234         destination(df_kern);
235 };
236
237 # lpr.*                           -/var/log/lpr.log
238 log {
239         source(s_all);
240         filter(f_lpr);
241         destination(df_lpr);
242 };
243
244 # mail.*                          -/var/log/mail.log
245 log {
246         source(s_all);
247         filter(f_mail);
248         destination(df_mail);
249 };
250
251 # user.*                          -/var/log/user.log
252 log {
253         source(s_all);
254         filter(f_user);
255         destination(df_user);
256 };
257
258 # uucp.*                          /var/log/uucp.log
259 log {
260         source(s_all);
261         filter(f_uucp);
262         destination(df_uucp);
263 };
264
265 # mail.info                       -/var/log/mail.info
266 log {
267         source(s_all);
268         filter(f_mail);
269         filter(f_at_least_info);
270         destination(df_mail_info);
271 };
272
273 # mail.warn                       -/var/log/mail.warn
274 log {
275         source(s_all);
276         filter(f_mail);
277         filter(f_at_least_warn);
278         destination(df_mail_warn);
279 };
280
281 # mail.err                        /var/log/mail.err
282 log {
283         source(s_all);
284         filter(f_mail);
285         filter(f_at_least_err);
286         destination(df_mail_err);
287 };
288
289 # news.crit                       /var/log/news/news.crit
290 log {
291         source(s_all);
292         filter(f_news);
293         filter(f_at_least_crit);
294         destination(df_news_dot_crit);
295 };
296
297 # news.err                        /var/log/news/news.err
298 log {
299         source(s_all);
300         filter(f_news);
301         filter(f_at_least_err);
302         destination(df_news_dot_err);
303 };
304
305 # news.notice                     /var/log/news/news.notice
306 log {
307         source(s_all);
308         filter(f_news);
309         filter(f_at_least_notice);
310         destination(df_news_dot_notice);
311 };
312
313
314 # *.=debug;\
315 #         auth,authpriv.none;\
316 #         news.none;mail.none     -/var/log/debug
317 log {
318         source(s_all);
319         filter(f_debug);
320         destination(df_debug);
321 };
322
323
324 # *.=info;*.=notice;*.=warn;\
325 #         auth,authpriv.none;\
326 #         cron,daemon.none;\
327 #         mail,news.none          -/var/log/messages
328 log {
329         source(s_all);
330         filter(f_messages);
331         destination(df_messages);
332 };
333
334 # *.emerg                         *
335 log {
336         source(s_all);
337         filter(f_emerg);
338         destination(du_all);
339 };
340
341
342 # daemon.*;mail.*;\
343 #         news.crit;news.err;news.notice;\
344 #         *.=debug;*.=info;\
345 #         *.=notice;*.=warn       |/dev/xconsole
346 log {
347         source(s_all);
348         filter(f_xconsole);
349         destination(dp_xconsole);
350 };
351