Skip to content

pazakharov/yii2-log-loki-target

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii2-loki-log-target

Yii2 log target for loki

Setup

install via composer

composer require pazakharov/yii2-log-loki-target

add the log as target:

 'targets' => [
                'loki' => [
                    'class' => \pazakharov\yii2\LokiTarget::class,
                    'levels' => ['warning'],
                    'label' => 'loki',
                    'lokiUrl' => '/api/v1/push',
                    'client' => [
                        'class' => \yii\httpclient\Client::class,
                        'baseUrl' => env('LOKI_HOST')
                    ],
                ],
            ],

You can define property 'formatMessageCallback' - callable that format message before sending it to the loki server

About

Loki target for yii2 Logger

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages