freshbitsweb / laravel-log-enhancer

Make debugging easier by adding more data to your laravel logs (Laravel 5.6+)
MIT License
346 stars 33 forks source link
error-reporting laravel laravel-5-package logging php php7

Latest Stable Version Total Downloads License StyleCI Buy us a tree

Laravel Log Enhancer (Laravel 5.6 to Laravel 11.x)

Laravel logs help all of us debug issues. We value them the most in production. But, the contextual data of the request is not logged by default. We need more than just stack trace to debug the issue easily. The things like request URL, request input data, session data, etc. help us hunt down the exact cause quickly. That's what this plug-and-play Laravel package does for you :)

Before

Before

After

After

Requirements

PHP Laravel Package
8.2+ 11.x v1.7.0
8.1+ 10.x v1.6.0
8.0+ 9.x v1.5.0
8.0+ 9.x v1.4.0
7.3+ 8.x v1.3.0
7.2.5+ 7.x v1.2.0
<7.2.5 6.x v1.1.0
<7.1 5.x v1.0.*

Notes:

Installation

1) Install the package by running this command in your terminal/cmd:

composer require freshbitsweb/laravel-log-enhancer

2) Add this package's LogEnhancer class to the tap option of your log channel in config/logging.php:

'production_stack' => [
    'driver' => 'stack',
    'tap' => [Freshbitsweb\LaravelLogEnhancer\LogEnhancer::class],
    'channels' => ['daily', 'slack'],
],

Optionally, you can import config file by running this command in your terminal/cmd:

php artisan vendor:publish --tag=laravel-log-enhancer-config

It has following configuration settings:

Lumen compatibility

We do not use Lumen in any of our projects. And this package is not tested with Lumen framework. If you are willing to use this package with Lumen, please help us by testing and making a PR to make it work. Thanks.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Treeware

You're free to use this package, but if it makes it to your production environment I would highly appreciate you buying the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you contribute to our forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees at for our forest here offset.earth/treeware

Read more about Treeware at treeware.earth

Special Thanks to