Author: mturk
Date: Sat Aug 19 03:28:58 2006
New Revision: 432828

URL: http://svn.apache.org/viewvc?rev=432828&view=rev
Log:
Log [PID:TID] only when threads are enabled.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_util.c

Modified: tomcat/connectors/trunk/jk/native/common/jk_util.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.c?rev=432828&r1=432827&r2=432828&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_util.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_util.c Sat Aug 19 03:28:58 2006
@@ -317,6 +317,7 @@
         used = set_time_str(buf, usable_size);
 
         if (line) {
+#if _MT_CODE
             /* Log [pid:threadid] for all levels except REQUEST. */
             /* This information helps to correlate lines from different logs. 
*/
             /* Performance is no issue, because with production log levels */
@@ -328,6 +329,19 @@
             rc = snprintf(&buf[used], usable_size - used,
                              "[%04d:%04d] ", getpid(), jk_gettid());
 #endif
+#else
+            /* Log [pid] for all levels except REQUEST. */
+            /* This information helps to correlate lines from different logs. 
*/
+            /* Performance is no issue, because with production log levels */
+            /* we only call it often, if we have a lot of errors */
+#ifdef USE_SPRINTF              /* until we get a snprintf function */
+            rc = sprintf(&buf[used], "[%04d] ", getpid());
+#else
+            rc = snprintf(&buf[used], usable_size - used,
+                             "[%04d] ", getpid());
+#endif
+#endif
+
             used += rc;
             if (rc < 0 || usable_size - used < 8) {
                 return 0;



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to