elgibor-solution / laravel-loki-logging
There is no license information available for the latest version (dev-master) of this package.
Logging to Loki for Laravel (PHP 8)
dev-master
2022-11-16 10:34 UTC
Requires
- php: ^8.0
- ext-json: *
- illuminate/console: ^8 || ^9
- illuminate/support: ^8 || ^9
- monolog/monolog: ^2
This package is auto-updated.
Last update: 2024-12-16 15:18:37 UTC
README
Logging to Loki for Laravel
Fork https://github.com/rdemorais/laravel-loki-logging
Usage
- Install this package:
composer require elgibor-solution/laravel-loki-logging
- Publish the configuration:
php artisan vendor:publish --provider=ESolution\\LaravelLokiLogging\\L3ServiceProvider
- Create a new log channel in
config/logging.php
:'loki' => [ 'driver' => 'monolog', 'handler' => L3Logger::class, ]
- Configure at least the
LOG_CHANNEL
,LOG_USERNAME
andLOG_PASSWORD
- Ensure
APP_NAME
is configured appropriately. If this value cannot be changed, useLOG_APP
. - Optionally configure
LOG_SERVER
andLOG_FORMAT
- Ensure
- Configure the
loki:persist
job to run periodically in your schedule. We recommend every minute, but feel free to reduce this. Log::info('Hello Loki!');
Configuration
The behaviour of the logger can be adjusted with the config options below.