Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/pazakharov/yii2-log-loki-target
- Owner: pazakharov
- License: mit
- Created: 2022-12-30T03:04:15.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-01-10T10:54:45.000Z (over 1 year ago)
- Last Synced: 2024-09-18T09:12:26.318Z (9 days ago)
- Topics: loki, yii2
- Language: PHP
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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