]> granicus.if.org Git - apache/commitdiff
Add process id and thread id (if APR has thread support)
authorRainer Jung <rjung@apache.org>
Mon, 7 Jun 2010 12:23:26 +0000 (12:23 +0000)
committerRainer Jung <rjung@apache.org>
Mon, 7 Jun 2010 12:23:26 +0000 (12:23 +0000)
to the error log.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@952201 13f79535-47bb-0310-9956-ffa450edef68

server/log.c

index d41821da52d7b4e6076fcef8096fbb9680779bc5..39d6f6bf60d4c27ec899a2070090c183edbd2a3a 100644 (file)
@@ -28,6 +28,7 @@
 #include "apr_thread_proc.h"
 #include "apr_lib.h"
 #include "apr_signal.h"
+#include "apr_portable.h"
 
 #define APR_WANT_STDIO
 #define APR_WANT_STRFUNC
@@ -620,6 +621,18 @@ static void log_error_core(const char *file, int line, int module_index,
     if ((level & APLOG_STARTUP) != APLOG_STARTUP) {
         len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
                             "[%s] ", priorities[level_and_mask].t_name);
+
+        len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
+                            "[%" APR_PID_T_FMT, getpid());
+#if APR_HAS_THREADS
+        {
+            apr_os_thread_t tid = apr_os_thread_current();
+            len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
+                                ":%pT", &tid);
+        }
+#endif
+        errstr[len++] = ']';
+        errstr[len++] = ' ';
     }
 
     if (file && level_and_mask >= APLOG_DEBUG) {