mod_log_auth: Include username, if known
authorKim Alvefur <zash@zash.se>
Tue, 15 Mar 2016 16:46:44 +0100
changeset 2088 9d43095d915f
parent 2087 fed0a71a5e68
child 2089 8cb8004091f8
mod_log_auth: Include username, if known
mod_log_auth/mod_log_auth.lua
--- 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