Welcome Guest, Not a member yet? Register   Sign In
Log Message :: Log also the ip address
#1

[eluser]Mr. Fulop[/eluser]
I know this is not much but I need it...
For example when we get this error:
Quote:ERROR - 2009-11-03 03:20:10 --> The session cookie data did not match what was expected. This could be a possible hacking attempt.
it would make sense to have also the ip from where the attempt has been made.

In: ./system/libraries/Log.php
Line: 102
From:
Code:
$message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n";
Change it to:
Code:
<!-- some space -->

if (isset($_SERVER['REMOTE_ADDR'])) $ip = $_SERVER['REMOTE_ADDR'];
else $ip = 'unknown ip or cron job';
$message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' - '.$ip.' --> '.$msg."\n";

<!-- some space -->




Theme © iAndrew 2016 - Forum software by © MyBB