# phplogviewer **Repository Path**: wolf-code/phplogviewer ## Basic Information - **Project Name**: phplogviewer - **Description**: PHP框架日志在线查看 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-10-08 - **Last Updated**: 2024-12-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: PHP, log ## README # PHP日志查看器 > 目前只支持Laravel、ThinkPHP5+、ThinkPHP6+、ThinkPHP8+、webman > 要求 `php >= 7.4` ## 使用方法 ```shell composer require wolf-leo/phplogviewer ``` ## 预览图 ![](test/images/demo.png) ### ThinkPHP 框架中 ```php public function test() { return (new \Wolfcode\PhpLogviewer\thinkphp\LogViewer())->fetch(); } // Version in ThinkPHP 5.X public function test() { return (new \Wolfcode\PhpLogviewer\thinkphp\LogViewerOld())->fetch(); } ``` ### Laravel 框架中 ```php public function test() { return (new \Wolfcode\PhpLogviewer\laravel\LogViewer())->fetch(); } ``` ### webman 框架中 ```php // 如果项目中采用 laravel 组件 public function test() { return (new \Wolfcode\PhpLogviewer\webman\laravel\LogViewer())->fetch(); } ``` ```php // 如果项目中采用 thinkphp 组件 public function test() { return (new \Wolfcode\PhpLogviewer\webman\thinkphp\LogViewer())->fetch(); } ``` > 可自定义配置 > > 在 `config` 下新建 `logviewer.php` 文件 ```php 'ThinkPHP 日志查看器', // 默认显示日志应用模块 'default_module' => 'index', // 常用的日志应用模块 'modules' => [ 'admin', 'home', 'index', 'api' ], // layui css 路径 如不设置,将默认调用公共CDN资源 'layui_css_path' => '', // layui js 路径 如不设置,将默认调用公共CDN资源 'layui_js_path' => '', // 自定义属性 'customize' => [ // css 可以修改页面相关样式 'css' => '/static/xxx/xxx.css', // js 可以控制页面相关属性 'js' => '/static/xxx/xxx.js', ], ]; ```