Download the PHP package darkton/laravel-loki without Composer
On this page you can find all versions of the php package darkton/laravel-loki. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-loki
Laravel Loki
⚠️ Beta release
The API is considered stable for testing and production use, but may change before the first stable release (v1.0.0).
A Laravel logging package that ships logs to Grafana Loki via OTLP, built on top of Monolog.
It uses Redis buffering and queued jobs to ensure safe, asynchronous delivery without impacting application performance or creating logging feedback loops.
Installation
You can install the package directly via Packagist using Composer:
After installation, you can optionally publish the configuration file (useful for customizing Grafana access, batch limits, and queues to be used):
Basic Configuration (.env)
In your .env file, you will need to set up the following Grafana Loki credentials to be able to send logs:
How to access / Basic Usage
To enable sending logs to loki, you must register this channel in Laravel's logging structure.
In your config/logging.php file, add it to the channels array:
Now you can log normally and direct your default stack to "loki" or access the channel directly:
The Dispatcher (Sync Command)
Monolog's LokiRedisHandler does not send HTTP requests immediately. Instead, it saves them in a secure Redis list (buffer).
To actually ship these logs to Grafana Loki, you need to call the sync command. It will read the buffer, split it into organized batches, and dispatch a Laravel Job to perform the OTLP async request:
You can call it manually:
Ideally, you should schedule it in your console infrastructure (routes/console.php or app/Console/Kernel.php depending on your Laravel version):
Tip: Make sure your
queue:worksupervisors or Horizon are running on your server, as the heavy pushing is offloaded to your application's queues!
License
This package is distributed and licensed under the terms of the MIT license.
All versions of laravel-loki with dependencies
illuminate/support Version ^12.0
illuminate/http Version ^12.0
illuminate/bus Version ^12.0
illuminate/queue Version ^12.0
illuminate/console Version ^12.0
illuminate/cache Version ^12.0
illuminate/redis Version ^12.0
monolog/monolog Version ^3.0