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