%{tid}P gets you thread id in decimal now.
%{hextid}P would show it in hex using relatively new apr_sprintf()
format, added in 1.2.0.
Index: modules/loggers/mod_log_config.c
===================================================================
--- modules/loggers/mod_log_config.c    (revision 240100)
+++ modules/loggers/mod_log_config.c    (working copy)
@@ -650,13 +650,15 @@
     if (*a == '\0' || !strcmp(a, "pid")) {
         return apr_psprintf(r->pool, "%" APR_PID_T_FMT, getpid());
     }
-    else if (!strcmp(a, "tid")) {
+    else if (!strcmp(a, "tid") || !strcmp(a, "hextid")) {
 #if APR_HAS_THREADS
         apr_os_thread_t tid = apr_os_thread_current();
 #else
         int tid = 0; /* APR will format "0" anyway but an arg is needed */
 #endif
-        return apr_psprintf(r->pool, "%pT", &tid);
+        return apr_psprintf(r->pool,
+                            *a == 'h' ? "%pt" : "%pT",
+                            &tid);
     }
     /* bogus format */
     return a;

Reply via email to