jotweh/codeception-monolog
最新稳定版本:1.1.0
Composer 安装命令:
composer require jotweh/codeception-monolog
包简介
Monolog Extension for Codeception
README 文档
README
What is it?
The default Codeception Logger extension (see http://codeception.com/addons) always uses a RotatingFileHandler for Logging, which writes to a codeception-<date>.log file. This was not sufficient for me so I created this configurable Monolog logging extension. It allows usage of multiple log handlers with custom configuration (see below for an example).
Currently only log handlers are supported, that do not require objects in their constructor parameters, such as:
- NativeMailHandler
- FirePHPHandler
- RotatingFileHandler
- HipChatHandler
- ErrorLogHandler
- ...
The log handlers will currently only be triggered in case of a failed test.
Installation
Currently not available via packagist, so you'll have to add this to your composer.json:
...
"repositories": [
{
"type": "vcs",
"url": "git@github.com:jotweh/codeception-monolog.git"
}
],
"require": {
"jotweh/codeception-monolog": "dev-master",
...
}
...
Configuration
Enable the Extension in your codeception.yaml like this:
extensions:
enabled:
- Codeception\Extension\CodeceptionMonolog
You can configure multiple log handlers in your codeception.yaml:
extensions:
enabled:
- Codeception\Extension\CodeceptionMonolog
config:
Codeception\Extension\CodeceptionMonolog:
message: "Test %s failed. Please check. Error Message: %s."
handlers:
NativeMailerHandler:
to: 'test@example.com,othertest@example.com'
subject: 'Email Subject'
from: 'Monitoring'
level: 400 #error log level
HipChatHandler:
token: 'somecryptichipchattoken'
room: 'HipChatRoomName'
name: 'Notifier'
notify: true
level: 400 #error log level
In the handlers section, each key is a Monolog handler class name. The values are the constructor parameters for the handler. In the example above, the HipChatHandler and the NativeMailerHandler are used. So when a test fails, an email and a hipchat notification will be sent.
统计信息
- 总下载量: 704
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-11