Skip to content

Commit

Permalink
Add referer in error.log
Browse files Browse the repository at this point in the history
Add referer URL in error log, below Request URL.
If the referal is '/' ignore it because it was a direct visit
  • Loading branch information
highstrike authored and markstory committed Jan 23, 2016
1 parent 6c1d5dd commit f6037cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Error/BaseErrorHandler.php
Expand Up @@ -296,6 +296,11 @@ protected function _getMessage(Exception $exception)
$request = Router::getRequest();
if ($request) {
$message .= "\nRequest URL: " . $request->here();

$referer = $request->env('HTTP_REFERER');
if ($referer) {
$message .= "\nReferer URL: " . $referer;
}
}
}
if (!empty($config['trace'])) {
Expand Down

0 comments on commit f6037cd

Please sign in to comment.