aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/loggingmanager.lua6
-rw-r--r--util/startup.lua7
2 files changed, 6 insertions, 7 deletions
diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua
index 23aa8e64..deaeddc3 100644
--- a/core/loggingmanager.lua
+++ b/core/loggingmanager.lua
@@ -18,7 +18,6 @@ local getstyle, getstring = require "util.termcolours".getstyle, require "util.t
local config = require "core.configmanager";
local logger = require "util.logger";
-local prosody = prosody;
local _ENV = nil;
-- luacheck: std none
@@ -152,13 +151,8 @@ local function reload_logging()
for name, sink_maker in pairs(old_sink_types) do
log_sink_types[name] = sink_maker;
end
-
- prosody.events.fire_event("logging-reloaded");
end
-reload_logging();
-prosody.events.add_handler("reopen-log-files", reload_logging);
-
--- Definition of built-in logging sinks ---
-- Null sink, must enter log_sink_types *first*
diff --git a/util/startup.lua b/util/startup.lua
index 0d7cb08a..0b62249b 100644
--- a/util/startup.lua
+++ b/util/startup.lua
@@ -84,7 +84,12 @@ end
function startup.init_logging()
-- Initialize logging
- require "core.loggingmanager"
+ local loggingmanager = require "core.loggingmanager"
+ loggingmanager.reload_logging();
+ prosody.events.add_handler("reopen-log-files", function ()
+ loggingmanager.reload_logging();
+ prosody.events.fire_event("logging-reloaded");
+ end);
end
function startup.log_dependency_warnings()