Line 0
Link Here
|
|
|
1 |
# |
2 |
# Configuration file for syslog-ng under Debian. |
3 |
# Customized for riseup.net using syslog-ng-anon patch |
4 |
# (http://dev.riseup.net/patches/syslog-ng/) |
5 |
# |
6 |
# see http://www.campin.net/syslog-ng/expanded-syslog-ng.conf |
7 |
# for examples. |
8 |
# |
9 |
# levels: emerg alert crit err warning notice info debug |
10 |
# |
11 |
|
12 |
############################################################ |
13 |
## global options |
14 |
|
15 |
options { |
16 |
chain_hostnames(0); |
17 |
time_reopen(10); |
18 |
time_reap(360); |
19 |
sync(0); |
20 |
log_fifo_size(2048); |
21 |
create_dirs(yes); |
22 |
group(adm); |
23 |
perm(0640); |
24 |
dir_perm(0755); |
25 |
use_dns(no); |
26 |
}; |
27 |
|
28 |
############################################################ |
29 |
## universal source |
30 |
|
31 |
source s_all { |
32 |
internal(); |
33 |
unix-stream("/dev/log"); |
34 |
file("/proc/kmsg" log_prefix("kernel: ")); |
35 |
}; |
36 |
|
37 |
############################################################ |
38 |
## generic destinations |
39 |
|
40 |
destination df_facility_dot_info { file("/var/log/$FACILITY.info"); }; |
41 |
destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); }; |
42 |
destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); }; |
43 |
destination df_facility_dot_err { file("/var/log/$FACILITY.err"); }; |
44 |
destination df_facility_dot_crit { file("/var/log/$FACILITY.crit"); }; |
45 |
|
46 |
############################################################ |
47 |
## generic filters |
48 |
|
49 |
filter f_strip { strip(ips); }; |
50 |
filter f_at_least_info { level(info..emerg); }; |
51 |
filter f_at_least_notice { level(notice..emerg); }; |
52 |
filter f_at_least_warn { level(warn..emerg); }; |
53 |
filter f_at_least_err { level(err..emerg); }; |
54 |
filter f_at_least_crit { level(crit..emerg); }; |
55 |
|
56 |
############################################################ |
57 |
## auth.log |
58 |
|
59 |
filter f_auth { facility(auth, authpriv); }; |
60 |
destination df_auth { file("/var/log/auth.log"); }; |
61 |
log { |
62 |
source(s_all); |
63 |
filter(f_auth); |
64 |
destination(df_auth); |
65 |
}; |
66 |
|
67 |
############################################################ |
68 |
## daemon.log |
69 |
|
70 |
filter f_daemon { facility(daemon); }; |
71 |
destination df_daemon { file("/var/log/daemon.log"); }; |
72 |
log { |
73 |
source(s_all); |
74 |
filter(f_daemon); |
75 |
destination(df_daemon); |
76 |
}; |
77 |
|
78 |
############################################################ |
79 |
## kern.log |
80 |
|
81 |
filter f_kern { facility(kern); }; |
82 |
destination df_kern { file("/var/log/kern.log"); }; |
83 |
log { |
84 |
source(s_all); |
85 |
filter(f_kern); |
86 |
destination(df_kern); |
87 |
}; |
88 |
|
89 |
############################################################ |
90 |
## user.log |
91 |
|
92 |
filter f_user { facility(user); }; |
93 |
destination df_user { file("/var/log/user.log"); }; |
94 |
log { |
95 |
source(s_all); |
96 |
filter(f_user); |
97 |
destination(df_user); |
98 |
}; |
99 |
|
100 |
############################################################ |
101 |
## sympa.log |
102 |
|
103 |
filter f_sympa { program("^(sympa|bounced|archived|task_manager)"); }; |
104 |
destination d_sympa { file("/var/log/sympa.log"); }; |
105 |
log { |
106 |
source(s_all); |
107 |
filter(f_sympa); |
108 |
destination(d_sympa); |
109 |
flags(final); |
110 |
}; |
111 |
|
112 |
############################################################ |
113 |
## wwsympa.log |
114 |
|
115 |
filter f_wwsympa { program("^wwsympa"); }; |
116 |
destination d_wwsympa { file("/var/log/wwsympa.log"); }; |
117 |
log { |
118 |
source(s_all); |
119 |
filter(f_wwsympa); |
120 |
filter(f_strip); |
121 |
destination(d_wwsympa); |
122 |
flags(final); |
123 |
}; |
124 |
|
125 |
############################################################ |
126 |
## ldap.log |
127 |
|
128 |
filter f_ldap { program("slapd"); }; |
129 |
destination d_ldap { file("/var/log/ldap.log"); }; |
130 |
log { |
131 |
source(s_all); |
132 |
filter(f_ldap); |
133 |
destination(d_ldap); |
134 |
flags(final); |
135 |
}; |
136 |
|
137 |
############################################################ |
138 |
## postfix.log |
139 |
|
140 |
# special source because of chroot jail |
141 |
#source s_postfix { unix-stream("/var/spool/postfix/dev/log" keep-alive(yes)); }; |
142 |
filter f_postfix { program("^postfix/"); }; |
143 |
destination d_postfix { file("/var/log/postfix.log"); }; |
144 |
log { |
145 |
source(s_all); |
146 |
filter(f_postfix); |
147 |
filter(f_strip); |
148 |
destination(d_postfix); |
149 |
flags(final); |
150 |
}; |
151 |
|
152 |
############################################################ |
153 |
## courier.log |
154 |
|
155 |
filter f_courier { program("courier|imap|pop"); }; |
156 |
destination d_courier { file("/var/log/courier.log"); }; |
157 |
log { |
158 |
source(s_all); |
159 |
filter(f_courier); |
160 |
filter(f_strip); |
161 |
destination(d_courier); |
162 |
flags(final); |
163 |
}; |
164 |
|
165 |
############################################################ |
166 |
## maildrop.log |
167 |
|
168 |
filter f_maildrop { program("^maildrop"); }; |
169 |
destination d_maildrop { file("/var/log/maildrop.log"); }; |
170 |
log { |
171 |
source(s_all); |
172 |
filter(f_maildrop); |
173 |
destination(d_courier); |
174 |
flags(final); |
175 |
}; |
176 |
|
177 |
############################################################ |
178 |
## mail.log |
179 |
|
180 |
filter f_mail { facility(mail); }; |
181 |
destination df_mail { file("/var/log/mail.log"); }; |
182 |
|
183 |
log { |
184 |
source(s_all); |
185 |
filter(f_mail); |
186 |
destination(df_mail); |
187 |
}; |
188 |
|
189 |
############################################################ |
190 |
## messages.log |
191 |
|
192 |
filter f_messages { |
193 |
level(debug,info,notice) |
194 |
and not facility(auth,authpriv,daemon,mail,user,kern); |
195 |
}; |
196 |
destination df_messages { file("/var/log/messages.log"); }; |
197 |
log { |
198 |
source(s_all); |
199 |
filter(f_messages); |
200 |
destination(df_messages); |
201 |
}; |
202 |
|
203 |
############################################################ |
204 |
## errors.log |
205 |
|
206 |
filter f_errors { |
207 |
level(warn,err,crit,alert,emerg) |
208 |
and not facility(auth,authpriv,daemon,mail,user,kern); |
209 |
}; |
210 |
destination df_errors { file("/var/log/errors.log"); }; |
211 |
log { |
212 |
source(s_all); |
213 |
filter(f_errors); |
214 |
destination(df_errors); |
215 |
}; |
216 |
|
217 |
############################################################ |
218 |
## emergencies |
219 |
|
220 |
filter f_emerg { level(emerg); }; |
221 |
destination du_all { usertty("*"); }; |
222 |
log { |
223 |
source(s_all); |
224 |
filter(f_emerg); |
225 |
destination(du_all); |
226 |
}; |
227 |
|
228 |
############################################################ |
229 |
## console messages |
230 |
|
231 |
filter f_xconsole { |
232 |
facility(daemon,mail) |
233 |
or level(debug,info,notice,warn) |
234 |
or (facility(news) |
235 |
and level(crit,err,notice)); |
236 |
}; |
237 |
destination dp_xconsole { pipe("/dev/xconsole"); }; |
238 |
log { |
239 |
source(s_all); |
240 |
filter(f_xconsole); |
241 |
destination(dp_xconsole); |
242 |
}; |
243 |
|