dskripchenko/laravel-delayed-log

Delayed logging.
3,013
Install
composer require dskripchenko/laravel-delayed-log
Latest Version:1.1.1
PHP:^8.2
License:MIT
Last Updated:Aug 6, 2026
Links: GitHub  ·  Packagist
Maintainer: dskripchenko

laravel-delayed-log

Asynchronous logging for Laravel. Log records are pushed onto a queue and written by a job instead of blocking the request — useful when your log target is slow (HTTP log sinks, external aggregators, etc.).

🌐 English · Deutsch · Русский · 中文

Packagist License

Requirements

PHP 8.2–8.5 · Laravel 11 / 12 / 13.

Install

composer require dskripchenko/laravel-delayed-log

The service provider is auto-discovered and merges a delayed log channel into your config/logging.php.

Usage

Point a channel (or your default LOG_CHANNEL) at delayed:

LOG_CHANNEL=delayed

# The channel the records are ultimately written to (default: stack)
LOG_DELAYED_CHANNEL=stack
# The queue the write job is dispatched on (default: delayed_log)
LOG_DELAYED_QUEUE=delayed_log
use Illuminate\Support\Facades\Log;

Log::channel('delayed')->info('Handled without blocking the request', ['user' => $id]);

Each record is dispatched as a DelayedLogJob onto LOG_DELAYED_QUEUE; a queue worker then writes it to the underlying LOG_DELAYED_CHANNEL. Make sure a worker is processing that queue:

php artisan queue:work --queue=delayed_log

How it works

The package registers a custom delayed channel whose Monolog handler (DelayedLogHandler) serializes each record and dispatches DelayedLogJob. The job re-emits the record on the real target channel from a worker process, so the originating request never waits on the log write.

License

MIT © Denis Skripchenko

Related Packages

backpack/logmanager

An interface to preview, download and delete Laravel log files.

749,017 274
infinety-es/logmanager

Laravel 5 interface to preview, download and delete Laravel log files.

85 1
understand/understand-laravel

Laravel service provider for Understand.io

113,481 24
understand/understand-laravel5

Laravel 5, 6, 7 and 8 service provider for Understand.io

589,732 24
kodicms/logs

The official KodiCMS logs module

60 0