天天看點

php 寫日志

private function log($message=''){
    $dir = __DIR__;
    $trueDir = dirname($dir).DIRECTORY_SEPARATOR.'Runtime'.DIRECTORY_SEPARATOR;
    $file = 'websocket'.date('Y_m_d').'.log';
    $trueFile = $trueDir.$file;
    file_put_contents($trueFile,$message.PHP_EOL,FILE_APPEND);
}      
php