From c866e400514617d4caca01d6ab86486509cd5eec Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 22 Jul 2018 19:41:29 +0200 Subject: sessionmanager: Log top tag of outgoing stanzas on c2s (#776) --- core/sessionmanager.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 6c9ecc24..ac387021 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -32,6 +32,7 @@ local function new_session(conn) local filter = initialize_filters(session); local w = conn.write; session.send = function (t) + session.log("debug", "sending: %s", t.top_tag and t:top_tag() or t:match("^[^>]*>?")); if t.name then t = filter("stanzas/out", t); end -- cgit v1.2.3 From 3f73da1155c3037a48abae227e661540fecabd04 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 22 Jul 2018 19:44:58 +0200 Subject: core.stanza_router: Reduce logging of common routing (#776) --- core/stanza_router.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/stanza_router.lua b/core/stanza_router.lua index 0be92f88..4caa89b6 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -207,7 +207,6 @@ function core_route_stanza(origin, stanza) -- old stanza routing code removed core_post_stanza(origin, stanza); else - log("debug", "Routing to remote..."); local host_session = hosts[from_host]; if not host_session then log("error", "No hosts[from_host] (please report): %s", tostring(stanza)); @@ -218,7 +217,7 @@ function core_route_stanza(origin, stanza) origin = origin, stanza = stanza, from_host = from_host, to_host = host }); stanza.attr.xmlns = xmlns; -- reset if not routed then - log("debug", "... no, just kidding."); + log("debug", "Could not route stanza to remote"); if stanza.attr.type == "error" or (stanza.name == "iq" and stanza.attr.type == "result") then return; end core_route_stanza(host_session, st.error_reply(stanza, "cancel", "not-allowed", "Communication with remote domains is not enabled")); -- cgit v1.2.3 From c2d1ea2b041c913393b1312faf8518256d33d1c2 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 22 Jul 2018 19:45:58 +0200 Subject: mod_s2s: Reduce logging (#776) --- plugins/mod_s2s/mod_s2s.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index 1f38c13a..f182df52 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -110,14 +110,12 @@ function route_to_existing_session(event) log("error", "Stanza: %s", tostring(stanza)); return false; else - (host.log or log)("debug", "going to send stanza to "..to_host.." from "..from_host); -- FIXME if host.from_host ~= from_host then log("error", "WARNING! This might, possibly, be a bug, but it might not..."); log("error", "We are going to send from %s instead of %s", tostring(host.from_host), tostring(from_host)); end if host.sends2s(stanza) then - host.log("debug", "stanza sent over %s", host.type); return true; end end -- cgit v1.2.3 From e59fdc42ed4f003adf01759e6d9e030a41305467 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 24 Jul 2018 19:07:26 +0200 Subject: sessionmanager, mod_s2s: Bring debug line for outgoing stanzas in line with that for incoming --- core/sessionmanager.lua | 2 +- plugins/mod_s2s/mod_s2s.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index ac387021..bdaafcb6 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -32,7 +32,7 @@ local function new_session(conn) local filter = initialize_filters(session); local w = conn.write; session.send = function (t) - session.log("debug", "sending: %s", t.top_tag and t:top_tag() or t:match("^[^>]*>?")); + session.log("debug", "Sending[%s]: %s", session.type, t.top_tag and t:top_tag() or t:match("^[^>]*>?")); if t.name then t = filter("stanzas/out", t); end diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index f182df52..0857f08e 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -541,7 +541,7 @@ local function initialize_session(session) local w = conn.write; function session.sends2s(t) - log("debug", "sending: %s", t.top_tag and t:top_tag() or t:match("^[^>]*>?")); + log("debug", "Sending[%s]: %s", session.type, t.top_tag and t:top_tag() or t:match("^[^>]*>?")); if t.name then t = filter("stanzas/out", t); end -- cgit v1.2.3