X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=core%2Floggingmanager.lua;fp=core%2Floggingmanager.lua;h=88f2bbbf506453d349427e2cb10de667ab2f200f;hb=f39f9b543cabdb44804783ccfc66271c6fba5faf;hp=be76681dd8ba217f1d218c33287cb37762897ec4;hpb=749102c2a31d83dbe902234f65dc740242fa1be9;p=prosody.git diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua index be76681d..88f2bbbf 100644 --- a/core/loggingmanager.lua +++ b/core/loggingmanager.lua @@ -88,14 +88,20 @@ end function apply_sink_rules(sink_type) if type(logging_config) == "table" then - if sink_type == "file" then - for _, level in ipairs(logging_levels) do - if type(logging_config[level]) == "string" then + for _, level in ipairs(logging_levels) do + if type(logging_config[level]) == "string" then + local value = logging_config[level]; + if sink_type == "file" then + add_rule({ + to = sink_type; + filename = value; + timestamps = true; + levels = { min = level }; + }); + elseif value == "*"..sink_type then add_rule({ - to = "file", - filename = logging_config[level], - timestamps = true, - levels = { min = level }, + to = sink_type; + levels = { min = level }; }); end end