summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-02-02 19:51:43 +0100
committerYorhel <git@yorhel.nl>2011-02-02 19:51:43 +0100
commit5d7fe06be6a167109b068605e9a60e3cfdfcb8ca (patch)
treec0964028a7c426db1912802b566b6992e0a522c7 /util
parent410bad954ae8f8a109e32e5bc1bf1150600489a6 (diff)
Log user ID in the TUWF log
Diffstat (limited to 'util')
-rwxr-xr-xutil/vndb.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/vndb.pl b/util/vndb.pl
index b845cb26..b6056dd4 100755
--- a/util/vndb.pl
+++ b/util/vndb.pl
@@ -46,6 +46,7 @@ TUWF::set(
%O,
pre_request_handler => \&reqinit,
error_404_handler => \&handle404,
+ log_format => \&logformat,
# for compatibility with YAWF
validate_templates => {
mail => { regex => qr/^[^@<>]+@[^@.<>]+(?:\.[^@.<>]+)+$/ },
@@ -124,3 +125,12 @@ sub handle404 {
$self->htmlFooter;
}
+
+# log user IDs (necessary for determining performance issues, user preferences
+# have a lot of influence in this)
+sub logformat {
+ my($self, $uri, $msg) = @_;
+ sprintf "[%s] %s %s: %s\n", scalar localtime(), $uri,
+ $self->authInfo->{id} ? 'u'.$self->authInfo->{id} : '-', $msg;
+}
+