Welcome Guest, Not a member yet? Register   Sign In
Error loging class
#1

[eluser]ELRafael[/eluser]
My contrib for this class

./system/libraries/Log.php (L:102)
Code:
//$message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n";
$message .= $level.' - '.gmdate($this->_date_fmt). ' --> '.$msg."\n";

Why?
Our server is in America but our visitors are in Portugal, so I need to write logs using gmdate.
The other thing is just to remove an unnecessary if
Code:
if ( $level == 'INFO' )
  echo ' -';
else
  echo '-';
//Just because a space between "-" and the message?

Regards
#2

[eluser]mddd[/eluser]
Why would you need to change the times? It seems to me that it is much more logical and reliable to use the server's own time in your logs. Maybe some of your visitors are in Brazil. Or in African countries. What does it matter? The log should help you locate problems, and for that, the server's time is important.
Example: if you see that something went wrong saving a file; how do you know the right time? The file modification times will not match your logfile!
#3

[eluser]ELRafael[/eluser]
99,999% you are right.

But sometimes I need to check by the user time.
I have some queries that need to check the user's time. So I need to check what time the query was run. In this case, the user time is muuuuch more important for me.
The file modification still the server time, not the user time.

But this is a special case.


[quote author="mddd" date="1275497608"]Why would you need to change the times? It seems to me that it is much more logical and reliable to use the server's own time in your logs. Maybe some of your visitors are in Brazil. Or in African countries. What does it matter? The log should help you locate problems, and for that, the server's time is important.
Example: if you see that something went wrong saving a file; how do you know the right time? The file modification times will not match your logfile![/quote]




Theme © iAndrew 2016 - Forum software by © MyBB