From 6d2370e922958599cfe856ffda32c08db4db7658 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 12 Feb 2012 15:04:58 -0500 Subject: [PATCH] Add syslog-ng post, and comment on increased git-daemon logging in gitweb post. --- posts/gitweb.mdwn | 6 ++++- posts/syslog-ng.mdwn | 57 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 posts/syslog-ng.mdwn diff --git a/posts/gitweb.mdwn b/posts/gitweb.mdwn index 5ed7d52..0c02a41 100644 --- a/posts/gitweb.mdwn +++ b/posts/gitweb.mdwn @@ -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 index 0000000..d60bcc1 --- /dev/null +++ b/posts/syslog-ng.mdwn @@ -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]] -- 2.26.2