1*4882a593Smuzhiyun@version: 3.36
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# Syslog-ng configuration file, compatible with default Debian syslogd
4*4882a593Smuzhiyun# installation. Originally written by anonymous (I can't find his name)
5*4882a593Smuzhiyun# Revised, and rewrited by me (SZALAY Attila <sasa@debian.org>)
6*4882a593Smuzhiyun#
7*4882a593Smuzhiyun# Move to 3.19
8*4882a593Smuzhiyun#     Only change is to add dns_cache(no) to options to suppress initialization warning.
9*4882a593Smuzhiyun#
10*4882a593Smuzhiyun#     Joe Slater <joe.slater@windriver.com>
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun# First, set some global options.
13*4882a593Smuzhiyunoptions { chain_hostnames(off); flush_lines(0); use_dns(no); dns_cache(no); use_fqdn(no);
14*4882a593Smuzhiyun	  owner("root"); group("adm"); perm(0640); stats_freq(0);
15*4882a593Smuzhiyun	  bad_hostname("^gconfd$");
16*4882a593Smuzhiyun};
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun########################
19*4882a593Smuzhiyun# Sources
20*4882a593Smuzhiyun########################
21*4882a593Smuzhiyun# This is the default behavior of sysklogd package
22*4882a593Smuzhiyun# Logs may come from unix stream, but not from another machine.
23*4882a593Smuzhiyun#
24*4882a593Smuzhiyunsource s_src { unix-dgram("/dev/log"); internal();
25*4882a593Smuzhiyun       	     file("/proc/kmsg" program_override("kernel"));
26*4882a593Smuzhiyun};
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun# If you wish to get logs from remote machine you should uncomment
29*4882a593Smuzhiyun# this and comment the above source line.
30*4882a593Smuzhiyun#
31*4882a593Smuzhiyun#source s_net { tcp(ip(127.0.0.1) port(1000) authentication(required) encrypt(allow)); };
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun########################
34*4882a593Smuzhiyun# Destinations
35*4882a593Smuzhiyun########################
36*4882a593Smuzhiyun# First some standard logfile
37*4882a593Smuzhiyun#
38*4882a593Smuzhiyundestination d_auth { file("/var/log/auth.log"); };
39*4882a593Smuzhiyundestination d_cron { file("/var/log/cron.log"); };
40*4882a593Smuzhiyundestination d_daemon { file("/var/log/daemon.log"); };
41*4882a593Smuzhiyundestination d_kern { file("/var/log/kern.log"); };
42*4882a593Smuzhiyundestination d_lpr { file("/var/log/lpr.log"); };
43*4882a593Smuzhiyundestination d_mail { file("/var/log/mail.log"); };
44*4882a593Smuzhiyundestination d_syslog { file("/var/log/syslog"); };
45*4882a593Smuzhiyundestination d_user { file("/var/log/user.log"); };
46*4882a593Smuzhiyundestination d_uucp { file("/var/log/uucp.log"); };
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun# This files are the log come from the mail subsystem.
49*4882a593Smuzhiyun#
50*4882a593Smuzhiyundestination d_mailinfo { file("/var/log/mail/mail.info"); };
51*4882a593Smuzhiyundestination d_mailwarn { file("/var/log/mail/mail.warn"); };
52*4882a593Smuzhiyundestination d_mailerr { file("/var/log/mail/mail.err"); };
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun# Logging for INN news system
55*4882a593Smuzhiyun#
56*4882a593Smuzhiyundestination d_newscrit { file("/var/log/news/news.crit"); };
57*4882a593Smuzhiyundestination d_newserr { file("/var/log/news/news.err"); };
58*4882a593Smuzhiyundestination d_newsnotice { file("/var/log/news/news.notice"); };
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun# Some 'catch-all' logfiles.
61*4882a593Smuzhiyun#
62*4882a593Smuzhiyundestination d_debug { file("/var/log/debug"); };
63*4882a593Smuzhiyundestination d_error { file("/var/log/error"); };
64*4882a593Smuzhiyundestination d_messages { file("/var/log/messages"); };
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun# The root's console.
67*4882a593Smuzhiyun#
68*4882a593Smuzhiyundestination d_console { usertty("root"); };
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun# Virtual console.
71*4882a593Smuzhiyun#
72*4882a593Smuzhiyundestination d_console_all { file("/dev/tty10"); };
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun# The named pipe /dev/xconsole is for the nsole' utility.  To use it,
75*4882a593Smuzhiyun# you must invoke nsole' with the -file' option:
76*4882a593Smuzhiyun#
77*4882a593Smuzhiyun#    $ xconsole -file /dev/xconsole [...]
78*4882a593Smuzhiyun#
79*4882a593Smuzhiyundestination d_xconsole { pipe("/dev/xconsole"); };
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun# Send the messages to an other host
82*4882a593Smuzhiyun#
83*4882a593Smuzhiyun#destination d_net { tcp("127.0.0.1" port(1000) authentication(on) encrypt(on) log_fifo_size(1000)); };
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun# Debian only
86*4882a593Smuzhiyundestination d_ppp { file("/var/log/ppp.log"); };
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun########################
89*4882a593Smuzhiyun# Filters
90*4882a593Smuzhiyun########################
91*4882a593Smuzhiyun# Here's come the filter options. With this rules, we can set which
92*4882a593Smuzhiyun# message go where.
93*4882a593Smuzhiyun
94*4882a593Smuzhiyunfilter f_dbg { level(debug); };
95*4882a593Smuzhiyunfilter f_info { level(info); };
96*4882a593Smuzhiyunfilter f_notice { level(notice); };
97*4882a593Smuzhiyunfilter f_warn { level(warn); };
98*4882a593Smuzhiyunfilter f_err { level(err); };
99*4882a593Smuzhiyunfilter f_crit { level(crit .. emerg); };
100*4882a593Smuzhiyun
101*4882a593Smuzhiyunfilter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
102*4882a593Smuzhiyunfilter f_error { level(err .. emerg) ; };
103*4882a593Smuzhiyunfilter f_messages { level(info,notice,warn) and
104*4882a593Smuzhiyun                    not facility(auth,authpriv,cron,daemon,mail,news); };
105*4882a593Smuzhiyun
106*4882a593Smuzhiyunfilter f_auth { facility(auth, authpriv) and not filter(f_debug); };
107*4882a593Smuzhiyunfilter f_cron { facility(cron) and not filter(f_debug); };
108*4882a593Smuzhiyunfilter f_daemon { facility(daemon) and not filter(f_debug); };
109*4882a593Smuzhiyunfilter f_kern { facility(kern) and not filter(f_debug); };
110*4882a593Smuzhiyunfilter f_lpr { facility(lpr) and not filter(f_debug); };
111*4882a593Smuzhiyunfilter f_local { facility(local0, local1, local3, local4, local5,
112*4882a593Smuzhiyun                        local6, local7) and not filter(f_debug); };
113*4882a593Smuzhiyunfilter f_mail { facility(mail) and not filter(f_debug); };
114*4882a593Smuzhiyunfilter f_news { facility(news) and not filter(f_debug); };
115*4882a593Smuzhiyunfilter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); };
116*4882a593Smuzhiyunfilter f_user { facility(user) and not filter(f_debug); };
117*4882a593Smuzhiyunfilter f_uucp { facility(uucp) and not filter(f_debug); };
118*4882a593Smuzhiyun
119*4882a593Smuzhiyunfilter f_cnews { level(notice, err, crit) and facility(news); };
120*4882a593Smuzhiyunfilter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); };
121*4882a593Smuzhiyun
122*4882a593Smuzhiyunfilter f_ppp { facility(local2) and not filter(f_debug); };
123*4882a593Smuzhiyunfilter f_console { level(warn .. emerg); };
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun########################
126*4882a593Smuzhiyun# Log paths
127*4882a593Smuzhiyun########################
128*4882a593Smuzhiyunlog { source(s_src); filter(f_auth); destination(d_auth); };
129*4882a593Smuzhiyunlog { source(s_src); filter(f_cron); destination(d_cron); };
130*4882a593Smuzhiyunlog { source(s_src); filter(f_daemon); destination(d_daemon); };
131*4882a593Smuzhiyunlog { source(s_src); filter(f_kern); destination(d_kern); };
132*4882a593Smuzhiyunlog { source(s_src); filter(f_lpr); destination(d_lpr); };
133*4882a593Smuzhiyunlog { source(s_src); filter(f_syslog3); destination(d_syslog); };
134*4882a593Smuzhiyunlog { source(s_src); filter(f_user); destination(d_user); };
135*4882a593Smuzhiyunlog { source(s_src); filter(f_uucp); destination(d_uucp); };
136*4882a593Smuzhiyun
137*4882a593Smuzhiyunlog { source(s_src); filter(f_mail); destination(d_mail); };
138*4882a593Smuzhiyun#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); };
139*4882a593Smuzhiyun#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); };
140*4882a593Smuzhiyun#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); };
141*4882a593Smuzhiyun
142*4882a593Smuzhiyunlog { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); };
143*4882a593Smuzhiyunlog { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); };
144*4882a593Smuzhiyunlog { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); };
145*4882a593Smuzhiyun#log { source(s_src); filter(f_cnews); destination(d_console_all); };
146*4882a593Smuzhiyun#log { source(s_src); filter(f_cother); destination(d_console_all); };
147*4882a593Smuzhiyun
148*4882a593Smuzhiyun#log { source(s_src); filter(f_ppp); destination(d_ppp); };
149*4882a593Smuzhiyun
150*4882a593Smuzhiyunlog { source(s_src); filter(f_debug); destination(d_debug); };
151*4882a593Smuzhiyunlog { source(s_src); filter(f_error); destination(d_error); };
152*4882a593Smuzhiyunlog { source(s_src); filter(f_messages); destination(d_messages); };
153*4882a593Smuzhiyun
154*4882a593Smuzhiyunlog { source(s_src); filter(f_console); destination(d_console_all);
155*4882a593Smuzhiyun				    destination(d_xconsole); };
156*4882a593Smuzhiyunlog { source(s_src); filter(f_crit); destination(d_console); };
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun# All messages send to a remote site
159*4882a593Smuzhiyun#
160*4882a593Smuzhiyun#log { source(s_src); destination(d_net); };
161