Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pazakharov/yii2-log-loki-target

Loki target for yii2 Logger
https://github.com/pazakharov/yii2-log-loki-target

loki yii2

Last synced: 2 days ago
JSON representation

Loki target for yii2 Logger

Awesome Lists containing this project

README

        

# Yii2-loki-log-target

Yii2 log target for loki

## Setup
install via composer

```bash
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