Diff

mod_log_auth/mod_log_auth.lua @ 2084:9d43095d915f

mod_log_auth: Include username, if known
author Kim Alvefur <zash@zash.se>
date Tue, 15 Mar 2016 16:46:44 +0100
parent 1427:322a076f53e8
child 2695:8b21f13b08c5
line wrap: on
line diff
--- 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