Add syslog-ng post, and comment on increased git-daemon logging in gitweb post.
authorW. Trevor King <wking@drexel.edu>
Sun, 12 Feb 2012 20:04:58 +0000 (15:04 -0500)
committerW. Trevor King <wking@drexel.edu>
Sun, 12 Feb 2012 20:04:58 +0000 (15:04 -0500)
posts/gitweb.mdwn
posts/syslog-ng.mdwn [new file with mode: 0644]

index 5ed7d52e8482af188e4f189dec69cedf84b1d56f..0c02a414ffaff74ba2720fbb1a82eaf74cacf191 100644 (file)
@@ -68,7 +68,7 @@ Git daemon
 Gitweb allows browsing repositories via HTTP, but if you will be
 pulling from your repositories using the `git://` protocol, you'll
 also want to run `git-daemon`.  On Gentoo, this is really easy, just
-edit `/etc/conf.d/git-daemon` as you see fit.  I added
+edit `/etc/conf.d/git-daemon` as you see fit.  I added `--verbose`,
 `--base-path=/var/git` and `--export-all` to `GITDAEMON_OPTS`.  Start
 the daemon with
 
@@ -78,6 +78,10 @@ Add it to your default runlevel with
 
     # rc-update add git-daemon default
 
+If you're logging to syslog and running syslog-ng, you can configure
+the log location using the usual syslog tricks.  See my [[syslog-ng]]
+for details.
+
 [summary]: http://www.philsergi.com/2008/04/gitweb-apache-gentoo.html
 
 [[!tag tags/git]]
diff --git a/posts/syslog-ng.mdwn b/posts/syslog-ng.mdwn
new file mode 100644 (file)
index 0000000..d60bcc1
--- /dev/null
@@ -0,0 +1,57 @@
+[syslog-ng][] is a nice, flexible logging system that I use on most of
+my boxes.  There's a good [admin guide][guide], but here are some
+short notes so I don't forget what I've done locally.
+
+I wanted to store my verbose [[git-daemon|gitweb]] logs in their own
+file, so I added the following to
+`/etc/syslog-ng/conf.d/git-daemon.conf`:
+
+    destination git_daemon_file {
+      file("/var/log/git-daemon");
+      };
+
+    filter git_daemon_filter {
+      program("git-daemon");
+      };
+
+    filter git_daemon_drop_filter {
+      #level(notice, debug);
+      level(debug);
+      };
+
+    log {
+      source(src);
+      filter(git_daemon_filter);
+      filter(git_daemon_drop_filter);
+      flags(final);
+      };
+
+    log {
+      source(src);
+      filter(git_daemon_filter);
+      destination(git_daemon_file);
+      flags(final);
+      };
+
+In `/etc/syslog-ng/syslog-ng.conf`, you'll want to add something like:
+
+    include "conf.d";
+
+to source the config files from `/etc/syslog-ng/conf.d` in
+alphabetical order.  You should add the `include` line before any
+`log` definitions so you can use `final` to in your auxiliary rules.
+
+Check that you didn't mess anything up with:
+
+    $ syslog-ng --syntax-only
+
+Restart `syslog-ng` with:
+
+    # /etc/init.d/syslog-ng reload
+
+
+[syslog-ng]: http://www.balabit.com/network-security/syslog-ng
+[guide]: http://www.balabit.com/sites/default/files/documents/syslog-ng-v3.0-guide-admin-en.html/bk01-toc.html
+
+[[!tag tags/tools]]
+[[!tag tags/linux]]