title: Get unique worker/thread/process/request ID in PHP
body: <p>In multi-threaded environments (like most web platforms) I often include some sort of thread ID to the logs of my apps. This enables me to tell exactly what log entry came from which request/thread, when there are multiple requests at once which are simultaneously writing to the same log.</p>
  
  <p>In .NET/C#, this can be done by the formatters of log4net, which by default include the current thread's <code>ManagedThreadId</code> (a number) or <code>Name</code> (a given name). These properties uniquely identify a thread (see for example: <a href="https://stackoverflow.com/questions/2882306/how-to-log-correct-context-with-threadpool-threads-using-log4net">How to log correct context with Threadpool threads using log4net?</a></p>
  
  <p>In PHP, I have not found anything similar (I asked Google, PHP docs and SO). Does it exist?</p>