httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r952201 - /httpd/httpd/trunk/server/log.c
Date Mon, 07 Jun 2010 12:23:26 GMT
Author: rjung
Date: Mon Jun  7 12:23:26 2010
New Revision: 952201

URL: http://svn.apache.org/viewvc?rev=952201&view=rev
Log:
Add process id and thread id (if APR has thread support)
to the error log.

Modified:
    httpd/httpd/trunk/server/log.c

Modified: httpd/httpd/trunk/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/log.c?rev=952201&r1=952200&r2=952201&view=diff
==============================================================================
--- httpd/httpd/trunk/server/log.c (original)
+++ httpd/httpd/trunk/server/log.c Mon Jun  7 12:23:26 2010
@@ -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 *f
     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) {



Mime
View raw message