-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
// ini_set('date.timezone','Asia/Shanghai'); | ||
$rawInput = file_get_contents('php://input'); | ||
$data = json_decode($rawInput, true); | ||
|
||
$text=$data['text']; | ||
// 获取当前日期,格式为 YYYY-MM-DD | ||
$today = date('Y-m-d'); | ||
// 获取当前时间,格式为 =HH:MM:SS | ||
$now = '['.date('H:i:s').']'; | ||
//日志文件夹 | ||
$dir='D:\\server-log\\'; | ||
//日志文件完整路径 | ||
$logfile=$dir.$today.'.log'; | ||
//添加当前时间 | ||
$log=$now.$text."\n"; | ||
//打开·创建·追加文件 | ||
$file=fopen($logfile,'a'); | ||
//写入日志 | ||
fwrite($file,$log); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.