定制 libelulasoft/yii2-error-handler 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

libelulasoft/yii2-error-handler

最新稳定版本:2.1.0

Composer 安装命令:

composer require libelulasoft/yii2-error-handler

包简介

Error handler for mongo databases

README 文档

README

Error handler for mongo database

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist libelulasoft/yii2-error-handler

or add

"libelulasoft/yii2-error-handler": "~1.0.0"

to the require section of your composer.json file.

Migration

Si se quiere migrar de la version taguz91/yii2-error-handler a la nueva version libelulasoft/yii2-error-handler se debe seguir los siguientes pasos:

  1. Seguir la guia de migracion para yii2-common-helpers.

  2. Eliminar la version actual

composer remove taguz91/yii2-error-handler
  1. Instalar la nueva version
composer require libelulasoft/yii2-error-handler
  1. Se debe cambiar el namespace taguz91\ErrorHandler a Libelulasoft\ErrorHandler en todo el proyecto.

  2. Actualizar las configuraciones de la libreria, agregando las nuevas opciones:

  • bdConnection nombre de la base de datos que se usara para guardar todas las excepciones.
  • saveError booleano que nos indica si debemos guardar los errores en base de datos.
  • showTrace booleano que nos indica si debemos mostrar le trace en la response, por defecto utiliza la constante YII_DEBUG
  • saveBody booleano que nos indica si debemos guardar los datos enviados por post en la excepcion, por defecto se utiliza la constante YII_DEBUG
  1. Probamos que todo funcione de forma correcta.

Usage

Once the extension is installed, simply use it in your code by:

// confing\main.php

'components' => [
  ...,
  'errorHandler' => [
    'errorAction' => 'site/error',
    'class' => \Libelulasoft\ErrorHandler\ErrorHandler::class,
    'loggerComponent' => '', // empty when the logger handler not exists
    'emailConfig' => 'EMAIL_ERROR_NOTIFICATION', // configuration for email
    'configClass' => '/common/models/Configuration', // debe implementar interface config
    'empresa' => $_GET['empresa'] ?? 'undefined',
    'bdConnection' => 'mongodb',
    'saveError' => true,
    'notificate' => true,
    'showTrace' => YII_DEBUG,
    'saveBody' => YII_DEBUG,
    // This exceptions not be save into database
    // And this exceptions not send via email
    'exceptionsNotSave' => [
      \Libelulasoft\ErrorHandler\exceptions\MessageException::class
    ],
  ],
]

统计信息

  • 总下载量: 17.66k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2022-11-10