stcer/j-watch-log

此包最新版本(0.3.8)没有提供许可证信息。

0.3.8 2018-06-08 09:33 UTC

This package is auto-updated.

Last update: 2024-08-31 00:37:01 UTC


README

用于监听服务器日志文件变化,类似于web版多文件同屏的 tail -f file效果,
主要用于像我一样喜欢开发调试基于日志文件的开发者。

注意:可以增加任何文件监听,但为了您的安全,请仅在测试环境下运行,或者自行增加防火墙规则以安全访问。

安装

composer install stcer/j-watch-log:*

配置

创建配置文件设置相关参数,配置logs监听多个日志文件,

使用 --config configFilePath 设置配置文件路径,
默认配置文件 project_root/config-watchLog.php

<?php

return [
    'server' => '0.0.0.0',
    'port' => 9504,
    'logs' => [
        __DIR__ . '/tmp/test.log'
    ]
];

用法

php vendor/bin/WatchLog.php -h

php WatchLog.php [options]

Options:
    -h, print this message
    -v, debug mode
    
    -d, run as a daemonize mode
    -a <action>, 
        stop: stop the server 
        restart: restart the server
    
    --config value, config file path, 
        default: project_root/config-watchLog.php

访问

http://your_server:port

待办事项

  1. 增加日志到用户监控
  2. 增加客户端收集远程主机日志