sofa/laravel-artisan-log

Logging for Laravel artisan commands and scheduled tasks

1.0.5 2023-01-31 11:06 UTC

This package is auto-updated.

Last update: 2024-11-29 06:28:36 UTC


README

Latest Stable Version MIT Licensed GitHub Tests Action Status Total Downloads

Installation

composer require sofa/laravel-artisan-log

# Optionally publish configuration to customize behavior:
php artisan vendor:publish --provider="Sofa\ArtisanLog\ArtisanLogServiceProvider"

Requires PHP7.4+ and Laravel 7+

This package provides a super simple logging functionality for chosen artisan commands and scheduled jobs.

By default it will start logging in the default channel your app is using:

[2020-05-16 22:00:01] production.INFO: [artisan scheduled starting] reminders:some-reminder
[2020-05-16 22:00:01] production.INFO: [artisan scheduled finished] reminders:some-reminder
[2020-05-16 22:00:01] production.INFO: [artisan starting] reminders:another-reminder
[2020-05-16 22:00:02] production.INFO: [artisan finished] reminders:another-reminder
[2020-05-16 23:00:02] production.INFO: [artisan starting] reminders:another-reminder
[2020-05-16 23:00:02] production.INFO: [artisan failed with exit code: 12] reminders:another-reminder
...

Configuration file contains references and examples how you may want to customize its behavior.