目前只支持Laravel、ThinkPHP5+、ThinkPHP6+、ThinkPHP8+、webman 要求
php >= 7.4
composer require wolf-leo/phplogviewer 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();
} public function test()
{
return (new \Wolfcode\PhpLogviewer\laravel\LogViewer())->fetch();
} // 如果项目中采用 laravel 组件
public function test()
{
return (new \Wolfcode\PhpLogviewer\webman\laravel\LogViewer())->fetch();
} // 如果项目中采用 thinkphp 组件
public function test()
{
return (new \Wolfcode\PhpLogviewer\webman\thinkphp\LogViewer())->fetch();
}可自定义配置
在
config下新建logviewer.php文件
<?php
return [
// 日志标题
'title' => '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',
],
];