欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長(zhǎng)資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          Hyperf日志如何查看組件

          Hyperf日志如何查看組件

          【相關(guān)學(xué)習(xí)推薦:php圖文教程

          最近在Hyperf中需要用到使用路由在線查看文件日志的功能,沒(méi)有發(fā)現(xiàn)比較好用的,自己簡(jiǎn)單寫(xiě)了一個(gè),支持查看和簡(jiǎn)單的內(nèi)容搜索。

          一、界面

          先上效果圖:

          Hyperf日志如何查看組件

          二、使用

          • 1.安裝組件

          composer require sett/hyperf-log-viewer

          • 2.發(fā)布配置文件

          php bin/hyperf.php vendor:publish sett/hyperf-log-viewer

          • 3.注冊(cè)路由

          Router::get('/logs', 'SettLogViewerControllerLogViewController@index');

          • 4.安裝view組件

          composer require hyperf/view

          • 5.安裝模板引擎

          composer require sy-records/think-template

          • 6.配置視圖
          return [         'engine' => ThinkEngine::class,         'mode'   => Mode::TASK,         'config' => [             // 若下列文件夾不存在請(qǐng)自行創(chuàng)建             'view_path'  => BASE_PATH . '/storage/view/',             'cache_path' => BASE_PATH . '/runtime/view/',         ],];
          • 7.配置組件參數(shù)

          在configautoloadlogViewer.php文件中,添加自己的日志文件目錄

          return [     "path" => BASE_PATH . "/runtime/logs/",     "pattern" => "*.log",     "size" => 10     ];

          三、說(shuō)明

          • 日志時(shí)間格式只支持年月日時(shí)分秒格式,否則可能看不到記錄

          相關(guān)學(xué)習(xí)推薦:php編程(視頻)

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)