esempla/yii2-log

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Many Yii2 log targets

0.8 2019-04-18 13:22 UTC

This package is auto-updated.

Last update: 2021-10-17 17:23:00 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