I was wondering if anybody knows of a way to alter the default way an error message gets logged in PHP. Hopefully this can be applied to ALL messages, fatal errors, warnings, etc. as well as any time my script calls upon the error_log.
Currently the default error messages show up in the log as
[19-Feb-2017 15:38:42 America/Vancouver] Could not post employee data - no rows submitted
[20-Feb-2017 11:12:34 America/Toronto] PHP Warning: array_splice() expects parameter ...
But what would be greatly beneficial to me is if I could have it also include some variables that i have stored in $_SESSION for each user, such as the user's login and company. So for example the error could be output like the following
[19-Feb-2017 15:38:42 America/Vancouver] [CompanyXYZ/bob_smith] Could not post employee data - no rows submitted
[20-Feb-2017 11:12:34 America/Toronto] [OtherCompany/jimbo_redneck] PHP Warning: array_splice() expects parameter ...
Does anything like this exist in the world of PHP?
Could not post employee data - no rows submittedcome from? That's not a PHP error. Wherever that is generated, add the other variables there.