Browse Source

Added IP to log result.

tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
4f2a69e9e1
  1. 3
      framework/logging/Target.php

3
framework/logging/Target.php

@ -238,6 +238,7 @@ abstract class Target extends \yii\base\Component
if (!is_string($text)) {
$text = var_export($text, true);
}
return date('Y/m/d H:i:s', $timestamp) . " [$level] [$category] $text\n";
$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';
return date('Y/m/d H:i:s', $timestamp) . " [$ip] [$level] [$category] $text\n";
}
}

Loading…
Cancel
Save