代码中打印日志方法

$content = $request->getContent();

if (isset($DMDprefs['debugSoap']) && $DMDprefs['debugSoap']) {
    $soapLogFile = sprintf(
        '/soap_xml_v50_%s.log',
        preg_replace('/[^a-zA-Z0-9-_]/', '_', php_uname('n'))
    );
    $fp = fopen($DMDprefs['mailLogDir'] . $soapLogFile, 'a');
    fwrite($fp, strftime('%F %T') . "\t" . PH::getRemoteAddr() . "\t" . $content . "\n");
    fclose($fp);
}

try{
    file_put_contents($logFile, $logContent, FILE_APPEND);
}catch(\Exception $e){

}

你可能感兴趣的:(前端)