Your message dated Tue, 22 May 2012 20:37:57 +0200
with message-id <[email protected]>
and subject line Re: [Pkg-varnish-devel] Bug#657449: Any verdict? :)
has caused the Debian Bug report #657449,
regarding varnishncsa: please add a config option to allow a custom logging
format (patch)
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
657449: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657449
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
Version: 3.0.2-3
Allard Hoeve <[email protected]> writes:
> Hello maintainers,
>
> Any verdict on this wishlist bug?
Hello,
The init script is already using the variable DAEMON_OPTS in
/etc/default/*. I've added an example in /etc/default/varnishncsa, and
documented it a bit better, which will be included in 3.0.2-3.
There is value in being able to set the log format as a separate
variable, but in the interest of keeping the init script simple, I think
I'll pass on this.
Thanks for reporting the bug, and providing a patch. (even if I chose
another solution in the end)
--
Stig Sandbeck Mathisen
pgpcjaDaqXBxN.pgp
Description: PGP signature
--- End Message ---