$des = './application/runtime/logs/api/api.log ';
$now = Date (' C ');
$now = Date (' y-m-d h:i:s ');
$log = ' NOTICE ';
$destination = ' db connection failed ';
Error_log ("[{$now}]". $destination. ' '. $_server[' remote_addr ']. ' '. $_server[' Request_uri ']. " \r\n{$log}\r\n ", 3, $des);
Returns the result of a write:
[2015-08-10 19:30:17] DB connection Failed 127.0.0.1/branches/v2.0.0/api/feed/getall?temp_token=1&contactuid=
NOTICE
[2015-08-10 19:30:41] DB connection Failed 127.0.0.1/branches/v2.0.0/api/feed/getall?temp_token=1&contactuid=
NOTICE
can refer to:
Thinkphp/log/driver/file.class.php can refer to the file
Upgrade version
$url = __file__;
$filename = End (explode (' \ ', $url));
$filename = DirName ($url);
$basename = basename (__file__);
echo $url;d ie;
Dump ($url);d ie;
echo $basename. '----';
$line = __line__;
echo $line. ' Line-';
echo $filename;
$des = './application/runtime/logs/api/api.log ';
$now = Date (' C ');
$now = Date (' y-m-d h:i:s ');
$log = ' NOTICE ';
$destination = ' db connection failed ';
Error_log ("[{$now}]". $destination. ' '. $_server[' remote_addr ']. ' '. $_server[' Request_uri ']. " \r\n{$log}\r\n ", 3, $des);
Error_log ("[{$now}]". $destination. ' '. $_server[' remote_addr ']. ' '. $_server[' Request_uri ']. ' '. basename (__file__). ' '. __line__. ' -line '. ' \r\n{$log}\r\n ", 3, $des);
Die
Log
[2015-08-11 12:41:56] DB connection failure 127.0.0.1/branches/v2.0.0/api/feed/getall?temp_token=1&contactuid= FeedController.class.php 29 lines
NOTICE
[2015-08-11 12:42:25] DB connection failure 127.0.0.1/branches/v2.0.0/api/feed/getall?temp_token=1&contactuid= FeedController.class.php 29 lines
NOTICE
[2015-08-11 12:42:45] DB connection failure 127.0.0.1/branches/v2.0.0/api/feed/getall?temp_token=1&contactuid= FeedController.class.php 29line
NOTICE
[2015-08-11 12:42:58] DB connection failure 127.0.0.1/branches/v2.0.0/api/feed/getall?temp_token=1&contactuid= FeedController.class.php 29-line
NOTICE
[2015-08-11 12:43:16] DB connection failure 127.0.0.1/branches/v2.0.0/api/feed/getall?temp_token=1&contactuid= FeedController.class.php 29-line
NOTICE