source: trunk/lvs/debian/config/etc/syslog-ng/syslog-ng.conf @ 1195

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