From: Michael Hampton Date: Mon, 16 Feb 2004 18:13:10 +0000 (+0000) Subject: * Log session IDs in syslog as well as stderr X-Git-Tag: v7.86~5612 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=ad11611af18c289b2cff724de71b17e75c788c47;p=citadel.git * Log session IDs in syslog as well as stderr --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 9677f66dd..8bbf4e783 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 614.32 2004/02/16 18:13:10 error + * Log session IDs in syslog as well as stderr + Revision 614.31 2004/02/16 15:06:44 error * Add specific error codes for every command on the wire protocol, so that clients can more easily determine what went wrong. Partially updated @@ -5334,3 +5337,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 930e8cf71..04ad3c325 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -104,13 +104,19 @@ int syslog_facility = (-1); void lprintf(int loglevel, const char *format, ...) { va_list arg_ptr; char buf[SIZ]; - + va_start(arg_ptr, format); vsnprintf(buf, sizeof(buf), format, arg_ptr); va_end(arg_ptr); if (syslog_facility >= 0) { if (loglevel <= verbosity) { + /* Hackery -IO */ + if (CC && CC->cs_pid) { + memmove(buf + 6, buf, sizeof(buf) - 6); + snprintf(buf, 6, "[%3d]", CC->cs_pid); + buf[5] = ' '; + } syslog(LOG_NOTICE, buf); } }