]> git.donarmstrong.com Git - dsa-puppet.git/blob - templates/syslog-ng.conf.erb
variable fixup
[dsa-puppet.git] / templates / syslog-ng.conf.erb
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 <% if kernel == 'Linux' %>
87         # standard Linux log source (this is the default place for the syslog()
88         # function to send logs to)
89         unix-stream("/dev/log");
90         # messages from the kernel
91         file("/proc/kmsg" log_prefix("kernel: "));
92 <% else %>
93         # standard Linux log source (this is the default place for the syslog()
94         # function to send logs to)
95         unix-dgram("/var/run/log");
96         # messages from the kernel
97         file("/dev/klog" log_prefix("kernel: "));
98 <%end%>
99         # use the following line if you want to receive remote UDP logging messages
100         # (this is equivalent to the "-r" syslogd flag)
101         # udp();
102 };
103
104
105 ######
106 # destinations
107
108 # some standard log files
109 destination df_auth { file("/var/log/auth.log"); };
110 destination df_syslog { file("/var/log/syslog"); };
111 destination df_cron { file("/var/log/cron.log"); };
112 destination df_daemon { file("/var/log/daemon.log"); };
113 destination df_kern { file("/var/log/kern.log"); };
114 destination df_lpr { file("/var/log/lpr.log"); };
115 destination df_mail { file("/var/log/mail.log" group(maillog)); };
116 destination df_mail_info { file("/var/log/mail.info" group(maillog)); };
117 destination df_mail_warn { file("/var/log/mail.warn" group(maillog)); };
118 destination df_mail_err { file("/var/log/mail.err" group(maillog)); };
119 destination df_user { file("/var/log/user.log" perm(0644)); };
120 destination df_uucp { file("/var/log/uucp.log"); };
121
122 # these files are meant for the mail system log files
123 # and provide re-usable destinations for {mail,cron,...}.info,
124 # {mail,cron,...}.notice, etc.
125 destination df_facility_dot_info { file("/var/log/$FACILITY.info"); };
126 destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); };
127 destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); };
128 destination df_facility_dot_err { file("/var/log/$FACILITY.err"); };
129 destination df_facility_dot_crit { file("/var/log/$FACILITY.crit"); };
130
131 # these files are meant for the news system, and are kept separated
132 # because they should be owned by "news" instead of "root"
133 destination df_news_dot_notice { file("/var/log/news/news.notice" owner("news")); };
134 destination df_news_dot_err { file("/var/log/news/news.err" owner("news")); };
135 destination df_news_dot_crit { file("/var/log/news/news.crit" owner("news")); };
136
137 # some more classical and useful files found in standard syslog configurations
138 destination df_debug { file("/var/log/debug"); };
139 destination df_messages { file("/var/log/messages"); };
140
141 <% if kernel == 'Linux' %>
142 # pipes
143 # a console to view log messages under X
144 destination dp_xconsole { pipe("/dev/xconsole"); };
145
146 <% end %>
147 # consoles
148 # this will send messages to everyone logged in
149 destination du_all { usertty("*"); };
150
151
152 ######
153 # filters
154
155 # all messages from the auth and authpriv facilities
156 filter f_auth { facility(auth, authpriv); };
157
158 # all messages except from the auth and authpriv facilities
159 filter f_syslog { not facility(auth, authpriv); };
160
161 # respectively: messages from the cron, daemon, kern, lpr, mail, news, user,
162 # and uucp facilities
163 filter f_cron { facility(cron); };
164 filter f_daemon { facility(daemon); };
165 filter f_kern { facility(kern); };
166 filter f_lpr { facility(lpr); };
167 filter f_mail { facility(mail); };
168 filter f_news { facility(news); };
169 filter f_user { facility(user); };
170 filter f_uucp { facility(uucp); };
171
172 # some filters to select messages of priority greater or equal to info, warn,
173 # and err
174 # (equivalents of syslogd's *.info, *.warn, and *.err)
175 filter f_at_least_info { level(info..emerg); };
176 filter f_at_least_notice { level(notice..emerg); };
177 filter f_at_least_warn { level(warn..emerg); };
178 filter f_at_least_err { level(err..emerg); };
179 filter f_at_least_crit { level(crit..emerg); };
180
181 # all messages of priority debug not coming from the auth, authpriv, news, and
182 # mail facilities
183 filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
184
185 # all messages of info, notice, or warn priority not coming form the auth,
186 # authpriv, cron, daemon, mail, and news facilities
187 filter f_messages {
188         level(info,notice,warn)
189             and not facility(auth,authpriv,cron,daemon,mail,news);
190 };
191
192 # messages with priority emerg
193 filter f_emerg { level(emerg); };
194
195 # complex filter for messages usually sent to the xconsole
196 filter f_xconsole {
197     facility(daemon,mail)
198         or level(debug,info,notice,warn)
199         or (facility(news)
200                 and level(crit,err,notice));
201 };
202
203
204 ######
205 # logs
206 # order matters if you use "flags(final);" to mark the end of processing in a
207 # "log" statement
208
209 # these rules provide the same behavior as the commented original syslogd rules
210
211 # auth,authpriv.*                 /var/log/auth.log
212 log {
213         source(s_all);
214         filter(f_auth);
215         destination(df_auth);
216 };
217
218 # *.*;auth,authpriv.none          -/var/log/syslog
219 log {
220         source(s_all);
221         filter(f_syslog);
222         destination(df_syslog);
223 };
224
225 # this is commented out in the default syslog.conf
226 # cron.*                         /var/log/cron.log
227 #log {
228 #        source(s_all);
229 #        filter(f_cron);
230 #        destination(df_cron);
231 #};
232
233 # daemon.*                        -/var/log/daemon.log
234 log {
235         source(s_all);
236         filter(f_daemon);
237         destination(df_daemon);
238 };
239
240 # kern.*                          -/var/log/kern.log
241 log {
242         source(s_all);
243         filter(f_kern);
244         destination(df_kern);
245 };
246
247 # lpr.*                           -/var/log/lpr.log
248 log {
249         source(s_all);
250         filter(f_lpr);
251         destination(df_lpr);
252 };
253
254 # mail.*                          -/var/log/mail.log
255 log {
256         source(s_all);
257         filter(f_mail);
258         destination(df_mail);
259 };
260
261 # user.*                          -/var/log/user.log
262 log {
263         source(s_all);
264         filter(f_user);
265         destination(df_user);
266 };
267
268 # uucp.*                          /var/log/uucp.log
269 log {
270         source(s_all);
271         filter(f_uucp);
272         destination(df_uucp);
273 };
274
275 # mail.info                       -/var/log/mail.info
276 log {
277         source(s_all);
278         filter(f_mail);
279         filter(f_at_least_info);
280         destination(df_mail_info);
281 };
282
283 # mail.warn                       -/var/log/mail.warn
284 log {
285         source(s_all);
286         filter(f_mail);
287         filter(f_at_least_warn);
288         destination(df_mail_warn);
289 };
290
291 # mail.err                        /var/log/mail.err
292 log {
293         source(s_all);
294         filter(f_mail);
295         filter(f_at_least_err);
296         destination(df_mail_err);
297 };
298
299 # news.crit                       /var/log/news/news.crit
300 log {
301         source(s_all);
302         filter(f_news);
303         filter(f_at_least_crit);
304         destination(df_news_dot_crit);
305 };
306
307 # news.err                        /var/log/news/news.err
308 log {
309         source(s_all);
310         filter(f_news);
311         filter(f_at_least_err);
312         destination(df_news_dot_err);
313 };
314
315 # news.notice                     /var/log/news/news.notice
316 log {
317         source(s_all);
318         filter(f_news);
319         filter(f_at_least_notice);
320         destination(df_news_dot_notice);
321 };
322
323
324 # *.=debug;\
325 #         auth,authpriv.none;\
326 #         news.none;mail.none     -/var/log/debug
327 log {
328         source(s_all);
329         filter(f_debug);
330         destination(df_debug);
331 };
332
333
334 # *.=info;*.=notice;*.=warn;\
335 #         auth,authpriv.none;\
336 #         cron,daemon.none;\
337 #         mail,news.none          -/var/log/messages
338 log {
339         source(s_all);
340         filter(f_messages);
341         destination(df_messages);
342 };
343
344 # *.emerg                         *
345 log {
346         source(s_all);
347         filter(f_emerg);
348         destination(du_all);
349 };
350
351
352 # daemon.*;mail.*;\
353 #         news.crit;news.err;news.notice;\
354 #         *.=debug;*.=info;\
355 #         *.=notice;*.=warn       |/dev/xconsole
356 log {
357         source(s_all);
358         filter(f_xconsole);
359         destination(dp_xconsole);
360 };
361