logger : log the readl client address when using a proxy

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2094 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-04-29 09:56:01 +00:00
parent 22432f3e90
commit 7c306e27ea

View File

@@ -67,10 +67,10 @@ class logger
for ($i = 0 ; $i <= $this->backTraceSkip ; $i++) for ($i = 0 ; $i <= $this->backTraceSkip ; $i++)
$back = array_shift ($backtrace); $back = array_shift ($backtrace);
$msg = ""; $msg = "";
if (isset ($_SERVER["REMOTE_ADDR"])) if (isset ($_SERVER["HTTP_X_FORWARDED_FOR"]))
{ $msg .= "[".$_SERVER["HTTP_X_FORWARDED_FOR"]."] ";
elseif (isset ($_SERVER["REMOTE_ADDR"]))
$msg .= "[".$_SERVER["REMOTE_ADDR"]."] "; $msg .= "[".$_SERVER["REMOTE_ADDR"]."] ";
}
// The messages are all the parameters of the function except the first, // The messages are all the parameters of the function except the first,
// which is the priority // which is the priority