I use function error_log() in my PHP script. If several instances of the script run concurrently, all of them will write into the same log file, and their messages will intermingle. I need to tell their records one from another.
I would be able to do so, if I had a unique ID for each running script, say, $script_id, so I would output a log message $message like this:
error_log($script_id . ': ' . $message);
but can I retrieve such a unique ID anywhere?
UPDATE 1: Or is there a better way of logging for these circumstances?
UPDATE 2: It would be interesting to retrieve the process ID of the process in which the script runs.