diff --git a/log.php b/log.php index 87b0ca13..5b7341d1 100644 --- a/log.php +++ b/log.php @@ -39,8 +39,11 @@ function write($text,$format='r') { $fw->write( $this->file, date($format). - (isset($_SERVER['REMOTE_ADDR'])? - (' ['.$_SERVER['REMOTE_ADDR'].']'):'').' '. + (isset($_SERVER['REMOTE_ADDR'])? + (' ['.$_SERVER['REMOTE_ADDR']. + (($fwd=filter_var($fw->get('HEADERS.X-Forwarded-For'), + FILTER_VALIDATE_IP))?(' ('.$fwd.')'):'') + .']'):'').' '. trim($line).PHP_EOL, TRUE );