itelmenko / laravel-mysql-logger

Laravel 5.6+ MySQL driver for Monolog
19 stars 8 forks source link

Change env by config in MySQLLogger #8

Closed luishenriqueamaral closed 4 years ago

luishenriqueamaral commented 4 years ago

Hi Igor

First of all, thanks for the great package.

I would like to suggest a change, at:

https://github.com/itelmenko/laravel-mysql-logger/blob/824b16660b65f673489a63a799f26c7044834af1/src/Logger/Laravel/Logging/MySQLLogger.php#L20

To:

$channel = $config['name'] ?? config('app.env');

This is because when config:cache is executed, env's variables are no longer accessible, as per this doc.

Thanks

itelmenko commented 4 years ago

@luishenriqueamaral Thank you for the fix. I have updated repo in commit 9a15432f912c634b5ec0a969e0975349985a879d

luishenriqueamaral commented 4 years ago

Thanks @itelmenko !