Code to capture errors php and store in a log