Reputation: 8593
PHP error logs typically look something like this:
[Tue Sep 02 15:46:13 2014] [error] [client 192.168.0.105] blah, blah, ... , referer: https://192.168.0.21/blah/blah
[Tue Sep 02 15:46:13 2014] [error] [client 192.168.0.105] blah, blee, ... , referer: https://192.168.0.21/blah/blee
How can I get them to look like this?
[Tue Sep 02 15:46:13 2014] [error] [client 192.168.0.105] blah, blah, ...
[Tue Sep 02 15:46:13 2014] [error] [client 192.168.0.105] blah, blee, ...
I tried $_SERVER['HTTP_REFERER']='';
but it (not surprisingly) didn't help.
Upvotes: 7
Views: 3563
Reputation: 201
(replying to an old question, I know, but I had to figure this out on my own recently, so maybe this will help somebody else...)
This can be done by setting the 'ErrorLogFormat' directive, either in your server config or virtualhost .conf file. Like this:
ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
Or maybe look up the default in your server config and modify that - you just need to get rid of %{Referer}i
, which is what adds the referer url.
Upvotes: 6