Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question
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


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.