Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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