esempla/yii2-log

Many Yii2 log targets

0.8 2019-04-18 13:22 UTC

This package is auto-updated.

Last update: 2024-10-17 23:29:08 UTC


README

Installation

The preferred way to install this extension is through composer.

add line to require section of composer.json

"esempla/yii2-log": "*"

Example Yii configuration

....
'components' => [
    'log' => [
        'targets' => [
            'logstash' =>   [
                'class' => 'esempla\\log\\LogstashTarget',
                'dsn' => 'tcp://logstash.esempla.srl:5044',
                'levels' => ['error', 'warning','info'],
                'index' => 'PROJECT_NAME'
            ]
        ]
        ....

Properties

  • dsn, default tcp://localhost:3333 - URL to logstash service. Allowed schemas: tcp, udp, unix - for unix sock files.
  • index, default logstash - index to logstash service
  • custom, default [] - array custom fields sended to logstash

Logstah guide

/docs/README.md