mkogg.py: Fix 'self.get_mp4_metadata(self, source)'
[blog.git] / posts / syslog-ng.mdwn
1 [syslog-ng][] is a nice, flexible logging system that I use on most of
2 my boxes.  There's a good [admin guide][guide], but here are some
3 short notes so I don't forget what I've done locally.
4
5 I wanted to store my verbose [[git-daemon|gitweb]] logs in their own
6 file, so I added the following to
7 `/etc/syslog-ng/conf.d/git-daemon.conf`:
8
9     destination git_daemon_file {
10       file("/var/log/git-daemon");
11       };
12
13     filter git_daemon_filter {
14       program("git-daemon");
15       };
16
17     filter git_daemon_drop_filter {
18       #level(notice, debug);
19       level(debug);
20       };
21
22     log {
23       source(src);
24       filter(git_daemon_filter);
25       filter(git_daemon_drop_filter);
26       flags(final);
27       };
28
29     log {
30       source(src);
31       filter(git_daemon_filter);
32       destination(git_daemon_file);
33       flags(final);
34       };
35
36 In `/etc/syslog-ng/syslog-ng.conf`, you'll want to add something like:
37
38     include "conf.d";
39
40 to source the config files from `/etc/syslog-ng/conf.d` in
41 alphabetical order.  You should add the `include` line before any
42 `log` definitions so you can use `final` to in your auxiliary rules.
43
44 Check that you didn't mess anything up with:
45
46     $ syslog-ng --syntax-only
47
48 Restart `syslog-ng` with:
49
50     # /etc/init.d/syslog-ng reload
51
52
53 [syslog-ng]: http://www.balabit.com/network-security/syslog-ng
54 [guide]: http://www.balabit.com/sites/default/files/documents/syslog-ng-v3.0-guide-admin-en.html/bk01-toc.html
55
56 [[!tag tags/tools]]
57 [[!tag tags/linux]]