Package: varnish Severity: wishlist Tags: patch Dear Maintainers,
I use a custom logging format that resembles our Apache logs (which also use a custom format). Please find a patch attached that adds an option to /etc/default/varnishncsa that allows the admin to specify a custom format. It also patches the init script to add the -F flag and the custom format if it is given, otherwise it does not give the -F flag at all. Please apply, Thanks, Allard Hoeve -- System Information: Debian Release: 6.0.3 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash
diff --git a/debian/varnish.varnishncsa.default b/debian/varnish.varnishncsa.default index e84327b..23935e2 100644 --- a/debian/varnish.varnishncsa.default +++ b/debian/varnish.varnishncsa.default @@ -6,3 +6,7 @@ # # NCSA log format, to be used by HTTP log analyzers # VARNISHNCSA_ENABLED=1 +# +# Specify a logformat here. See man varnishncsa for format details. If left +# blank or set to "default", the default format will be used. +# VARNISHNCSA_LOGFORMAT="default" diff --git a/debian/varnish.varnishncsa.init b/debian/varnish.varnishncsa.init index 30212bc..723798d 100644 --- a/debian/varnish.varnishncsa.init +++ b/debian/varnish.varnishncsa.init @@ -34,6 +34,12 @@ if [ -z "${VARNISHNCSA_ENABLED}" ] || \ exit 0; fi +# If set, and not set to "default", append the logformat option to DAEMON_OPTS +if [ ! -z "${VARNISHNCSA_LOGFORMAT}" -a ! "${VARNISHNCSA_LOGFORMAT}" = "default" ]; then + LOGFORMAT_FLAG="-F" + LOGFORMAT_FORMAT=${VARNISHNCSA_LOGFORMAT} +fi + test -x $DAEMON || exit 0 start_varnishncsa() { @@ -41,7 +47,7 @@ start_varnishncsa() { log_daemon_msg "Starting $DESC" "$NAME" create_pid_directory if start-stop-daemon --start --quiet --pidfile ${PIDFILE} \ - --chuid $USER --exec ${DAEMON} -- ${DAEMON_OPTS} \ + --chuid $USER --exec ${DAEMON} -- ${DAEMON_OPTS} ${LOGFORMAT_FLAG} ${LOGFORMAT_FORMAT} \ > ${output} 2>&1; then log_end_msg 0 else