diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_posix.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua index 7559d3ed..23757761 100644 --- a/plugins/mod_posix.lua +++ b/plugins/mod_posix.lua @@ -11,7 +11,17 @@ if not config_get("*", "core", "no_daemonize") then local logwriter; local logfilename = config_get("*", "core", "log"); - if logfilename then + if logfilename == "syslog" then + pposix.syslog_open("prosody"); + local syslog, format = pposix.syslog_log, string.format; + logwriter = function (name, level, message, ...) + if ... then + syslog(level, format(message, ...)); + else + syslog(level, message); + end + end; + elseif logfilename then local logfile = io.open(logfilename, "a+"); if logfile then local write, format, flush = logfile.write, string.format, logfile.flush; |