I have turned on mod_unique_id for my apache server and the apache logs show that the unique_id is indeed being logged. Also, I can now access $_SERVER['UNIQUE_ID'] via PHP through the $_SERVER superglobals array.

My question is, how can I make PHP log UNIQUE_ID for every log entry? It seems I can control it with my custom log entries, but I also want UNIQUE_ID logged for fatals where php cannot compile the code etc.

Thanks.

link|improve this question

feedback

1 Answer

up vote 0 down vote accepted

I use Zend_Log to log messages to error_log directive, so all I did was create a child class and override _log() method. In my method I check for UNIQUE_ID in $_SERVER global and if present, prepend message with it.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.