I am trying to parse PHP error log. The issue is that breaking the file by
doesn't work.
explode(PHP_EOL, $log)
This doesn't work because there are some error messages that contain
by itself.
How to break such file by lines then?
Extract of the problematic log:
[04-Jan-2012 21:28:48] PHP Notice: Use of undefined constant AY_FACEBOOK_TAB_URL - assumed 'AY_FACEBOOK_TAB_URL' in /var/www/[hidden]/default.layout.tpl.php on line 36
[04-Jan-2012 22:38:02] PHP Notice: Use of undefined constant AY_FACEBOOK_TAB_URL - assumed 'AY_FACEBOOK_TAB_URL' in /var/www/[hidden]/default.layout.tpl.php on line 36
[04-Jan-2012 23:43:33] PHP Warning: file_get_contents(https://graph.facebook.com/4294967295/picture?type=large): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error
in /var/www/[hidden]/result.tpl.php on line 11
[04-Jan-2012 23:43:33] PHP Notice: Undefined variable: image in /var/www/[hidden]/result.tpl.php on line 20
Notice the line break after HTTP/1.0 500 Internal Server Error
.