* Log session IDs in syslog as well as stderr
authorMichael Hampton <io_error@uncensored.citadel.org>
Mon, 16 Feb 2004 18:13:10 +0000 (18:13 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Mon, 16 Feb 2004 18:13:10 +0000 (18:13 +0000)
citadel/ChangeLog
citadel/sysdep.c

index 9677f66dd02d26939249a6db4be67737cd99a276..8bbf4e78318ad255cfd840cbfe3c2b78bb30d783 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 930e8cf71be1335110f442f84cc4c62ab0933918..04ad3c325e66757d80b43bf7fd38b872b5bb8c3b 100644 (file)
@@ -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);
                }
        }