gelige/yii2-rollbar-simple

为 Yii2 的 Rollbar

安装: 13

依赖: 0

建议: 0

安全: 0

星星: 1

观察者: 1

分支: 0

开放问题: 0

类型:yii2-extension

v1.0.1 2018-02-15 12:41 UTC

This package is not auto-updated.

Last update: 2024-09-29 05:29:24 UTC


README

Dependency Status Packagist

简单的 Rollbar 日志记录器,用于您的 Yii2 应用程序。

安装

通过 composer

要安装,可以运行

$ php composer.phar require gelige/yii2-rollbar-simple:1.0.*

或者将以下内容添加到您的 composer.json 文件的 require 部分:

"gelige/yii2-rollbar-simple": "1.0.*"

to the require section of your composer.json file.

使用方法

  1. 在您的 global main.php 配置文件中添加组件配置
'components' => [
    'rollbar' => [
        'class' => 'gelige\yii\rollbar\Rollbar',
        'accessToken' => 'POST_SERVER_ITEM_ACCESS_TOKEN',
    ],
],
  1. 在您的 global main.php 配置文件中添加一个新的日志目标
'components' => [
    'log' => [
        'targets' => [
            'class' => 'gelige\yii\rollbar\RollbarTarget',
            // 'except' => ['yii\web\HttpException:404'],
            // 'levels' => YII_DEBUG ? ['error', 'warning'] : ['error'],
        ],
    ],
],