yoeriboven / laravel-log-db

A database driver for logging with Laravel
MIT License
45 stars 13 forks source link

Update DatabaseHandler to ensure it can log to db before trying #16

Closed ZARk-be closed 10 months ago

ZARk-be commented 1 year ago

If trying to log before app is ready : ex: artisan command, etc.. The logger will throw exceptions. This ensures it can log before it logs.

I had the issue in a CI/CD where an artisan command would fail when building the docker image because of a config error. the DB logger would just spit out exceptions and impossible to find my real error :)

ZARk-be commented 11 months ago

Any feedback on this ?

yoeriboven commented 10 months ago

Do we need both checks? If you can access the database through the facade, doesn't that mean the app is booted?

yoeriboven commented 10 months ago

I issued a new version. Please let me know if that did not fix your issue.