Skip to content
yii2使用SeasLog写日志
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Update README.md Jul 25, 2019
Yii2SeasLog.php
composer.json Create composer.json Jul 25, 2019

README.md

yii2-seasLog extension

使用SeasLog高效日志扩展替换Yii2框架的日志模块,使其提高写日志效率。只需配置就可以实现。

SeasLog扩展https://github.com/SeasX/SeasLog/

Requirements

  • Yii2
  • PHP >=5.4
  • ext-seaslog installed

Installation

composer require wxxiong6/yii-seaslog:"1.0.0"

Usage

main.php

    'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                'default' => [
                    'class' => 'wxxiong6\yii\seaslog\Yii2SeasLog',
                    'levels' => ['trace', 'info', 'error', 'warning'],
                    'logFile' => 'backend/runtime/',
                    'logVars' => [],
                ],
            ],
        ],

为了跟yii2日志格式一致,修改php.ini seaslog日志格式

seaslog.default_template = %T %M

Changelog

Release 1.0 - Changelog
  • Official stable release
You can’t perform that action at this time.