1 Star 1 Fork 0

allenleong/PHPLink

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test.php 541 Bytes
一键复制 编辑 原始数据 按行查看 历史
liangyongbo 提交于 2020-11-24 16:33 +08:00 . add new log
<?php
require_once "vendor/autoload.php";
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
$log = new Logger('phpLink');
$path = dirname(__FILE__)."/log/app.log";
$log->pushHandler(new StreamHandler($path, Logger::DEBUG));
$file_exist = false;
while (1){
$file_exist = file_exists($path);
if(!$file_exist) {
$log->pushHandler(new StreamHandler($path, Logger::DEBUG));
}
var_dump($file_exist);
$file_exist = false;
echo "logging \n";
sleep(5);
$log->notice("123",array("test"));
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/allenleong/phplink.git
git@gitee.com:allenleong/phplink.git
allenleong
phplink
PHPLink
master

搜索帮助