mod_log_auth: Include username, if known

Tue, 15 Mar 2016 16:46:44 +0100

author
Kim Alvefur <zash@zash.se>
date
Tue, 15 Mar 2016 16:46:44 +0100
changeset 2084
9d43095d915f
parent 2083
fed0a71a5e68
child 2085
8cb8004091f8

mod_log_auth: Include username, if known

mod_log_auth/mod_log_auth.lua file | annotate | diff | comparison | revisions
--- a/mod_log_auth/mod_log_auth.lua	Tue Mar 15 16:46:02 2016 +0100
+++ b/mod_log_auth/mod_log_auth.lua	Tue Mar 15 16:46:44 2016 +0100
@@ -3,7 +3,7 @@
 
 if mode == "failure" or mode == "all" then
 	module:hook("authentication-failure", function (event)
-		module:log("info", "Failed authentication attempt (%s) from IP: %s", event.condition or "unknown-condition", event.session.ip or "?");
+		module:log("info", "Failed authentication attempt (%s) for user %s from IP: %s", event.condition or "unknown-condition", event.session.username or "?", event.session.ip or "?");
 	end);
 end
 

mercurial