larawelders/scheduler-event-logger

Log Laravel scheduler lifecycle events.

Maintainers

Package info

github.com/larawelders/scheduler-event-logger

pkg:composer/larawelders/scheduler-event-logger

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master / 1.0.x-dev 2026-05-07 02:47 UTC

This package is auto-updated.

Last update: 2026-05-07 03:51:17 UTC


README

Log Laravel scheduler lifecycle events to a dedicated schedule log channel.

Support Matrix

Package PHP Laravel
1.x 8.2+ 12.x / 13.x

Notes:

  • Laravel 12 supports PHP 8.2 through 8.5.
  • Laravel 13 requires PHP 8.3+, so PHP 8.2 is only valid with Laravel 12.

What it logs

  • ScheduledTaskStarting at info
  • ScheduledTaskFinished at info
  • ScheduledTaskFailed at error
  • ScheduledTaskSkipped at info
  • ScheduledBackgroundTaskFinished at info
  • SchedulePaused at info
  • ScheduleResumed at info

Installation

composer require larawelders/scheduler-event-logger

The package uses Laravel package discovery, so no manual provider registration is required.

The package registers a default schedule log channel at runtime if your application does not already define one. By default, it uses a daily channel that writes to date-named files under storage/logs/schedule.log.

If you want to customize the channel name or logger configuration, publish the package config:

php artisan vendor:publish --tag=scheduler-event-logger-config

The published config lets you change both the channel name and the underlying channel definition:

'channel' => 'schedule',

'channel_config' => [
    'driver' => 'daily',
    'path' => storage_path('logs/schedule.log'),
    'level' => 'debug',
],

If your application already defines a channel with the configured name in config/logging.php, the application definition takes precedence:

'channels' => [
    'schedule' => [
        'driver' => 'single',
        'path' => storage_path('logs/app-schedule.log'),
        'level' => 'info',
    ],
],

Example Output

[framework/schedule-9f57b5c9...] Starting task "daily-report" on timezone UTC
[framework/schedule-9f57b5c9...] Finished task "daily-report" on timezone UTC with exit code 0 in 0.125s
[framework/schedule-a1b3f70e...] Failed task `php artisan sync:vendors` after RuntimeException: API timeout
[framework/schedule-a1b3f70e...] Skipped task `php artisan sync:vendors`
[framework/schedule-70c74e7f...] Background task finished `php artisan imports:run` in background with exit code 0
[schedule] Paused
[schedule] Resumed

Development

composer install
composer run analyse