コード例 #1
0
 protected function logFileName()
 {
     $base = common_request_id();
     $base = preg_replace('/^(.+?) .*$/', '$1', $base);
     $base = str_replace(':', '-', $base);
     $base = rawurlencode($base);
     return $base;
 }
コード例 #2
0
ファイル: util.php プロジェクト: himmelex/NTW
function common_log($priority, $msg, $filename = null)
{
    if (Event::handle('StartLog', array(&$priority, &$msg, &$filename))) {
        $msg = '[' . common_request_id() . '] ' . $msg;
        $logfile = common_config('site', 'logfile');
        if ($logfile) {
            $log = fopen($logfile, "a");
            if ($log) {
                $output = common_log_line($priority, $msg);
                fwrite($log, $output);
                fclose($log);
            }
        } else {
            common_ensure_syslog();
            syslog($priority, $msg);
        }
        Event::handle('EndLog', array($priority, $msg, $filename));
    }
}