aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-19 05:11:37 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-19 05:11:37 +0000
commitf1966ba5b72e6b3d49fee3405958a2b2f86239a4 (patch)
tree6638d57690ee1180e0da7125a7e0034c4ac95e40
parent20d5d438a67cefa3dc13f0ae5cb2e293beecd36e (diff)
downloadprosody-f1966ba5b72e6b3d49fee3405958a2b2f86239a4.tar.gz
prosody-f1966ba5b72e6b3d49fee3405958a2b2f86239a4.zip
Log sent s2s stanzas
-rw-r--r--core/s2smanager.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index d6ad2be1..1a600db2 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -76,8 +76,8 @@ function new_incoming(conn)
getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; print("s2s session got collected, now "..open_sessions.." s2s sessions are allocated") end;
end
open_sessions = open_sessions + 1;
- local w = conn.write;
- session.sends2s = function (t) w(tostring(t)); end
+ local w, log = conn.write, logger_init("s2sin"..tostring(conn):match("[a-f0-9]+$"));
+ session.sends2s = function (t) log("debug", "sending: %s", tostring(t)); w(tostring(t)); end
return session;
end
@@ -124,13 +124,15 @@ function new_outgoing(from_host, to_host)
-- otherwise it will assume it is a new incoming connection
cl.register_outgoing(conn, host_session);
+ local log;
do
local conn_name = "s2sout"..tostring(conn):match("[a-f0-9]*$");
- host_session.log = logger_init(conn_name);
+ log = logger_init(conn_name);
+ host_session.log = log;
end
local w = conn.write;
- host_session.sends2s = function (t) w(tostring(t)); end
+ host_session.sends2s = function (t) log("debug", "sending: %s", tostring(t)); w(tostring(t)); end
conn.write(format([[<stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback' xmlns:stream='http://etherx.jabber.org/streams' from='%s' to='%s' version='1.0'>]], from_host, to_host));