Index: main/logger.c =================================================================== --- main/logger.c (revision 84510) +++ main/logger.c (working copy) @@ -89,7 +89,8 @@ static struct { unsigned int queue_log:1; unsigned int event_log:1; -} logfiles = { 1, 1 }; + unsigned int syslog_ng:1; +} logfiles = { 1, 1, 0 }; static char hostname[MAXHOSTNAMELEN]; @@ -336,6 +337,8 @@ logfiles.queue_log = ast_true(s); if ((s = ast_variable_retrieve(cfg, "general", "event_log"))) logfiles.event_log = ast_true(s); + if ((s = ast_variable_retrieve(cfg, "general", "syslog_ng"))) + logfiles.syslog_ng = ast_true(s); AST_LIST_LOCK(&logchannels); var = ast_variable_browse(cfg, "logfiles"); @@ -668,6 +671,11 @@ levels[level], (long)GETTID(), file, line, function); } s = buf + strlen(buf); + + /* syslog-ng is occasionally braindead on the first character in the message */ + if (logfiles.syslog_ng) + buf[s++] = "_"; + vsnprintf(s, sizeof(buf) - strlen(buf), fmt, args); term_strip(s, s, strlen(s) + 1); syslog(syslog_level_map[level], "%s", buf); Index: configs/logger.conf.sample =================================================================== --- configs/logger.conf.sample (revision 84510) +++ configs/logger.conf.sample (working copy) @@ -24,7 +24,11 @@ ; (defaults to yes). ;event_log = no ; +; If you're running syslog-ng and you use syslog logging, turn this +; option on to avoid a potentially stupid bug in syslog-ng. +;syslog_ng = yes ; +; ; For each file, specify what to log. ; ; For console logging, you set options at start of