2017 © Pedro Peláez
 

library codeception-monolog

Monolog Extension for Codeception

image

jotweh/codeception-monolog

Monolog Extension for Codeception

  • Wednesday, February 18, 2015
  • by jotweh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 688 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

codeception-monolog

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 * ..., (*1)

The log handlers will currently only be triggered in case of a failed test., (*2)

Installation

Currently not available via packagist, so you'll have to add this to your composer.json:, (*3)

  ...
  "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:, (*4)

extensions:
    enabled:
        - Codeception\Extension\CodeceptionMonolog

You can configure multiple log handlers in your codeception.yaml:, (*5)

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., (*6)

The Versions

18/02 2015

dev-master

9999999-dev https://github.com/jotweh/codeception-monolog

Monolog Extension for Codeception

  Sources   Download

MIT

The Requires

 

by Jan Wyszynski

logging monolog codeception monitoring

13/02 2015

1.1.0

1.1.0.0 https://github.com/jotweh/codeception-monolog

Monolog Extension for Codeception

  Sources   Download

MIT

The Requires

 

by Jan Wyszynski

logging monolog codeception monitoring

11/02 2015

1.0.0

1.0.0.0 https://github.com/jotweh/codeception-monolog

Monolog Extension for Codeception

  Sources   Download

MIT

The Requires

 

by Jan Wyszynski

logging monolog codeception monitoring