In my L5.4 application I am trying to write errors or logs to a file in the logs directory.
I Set my APP_DEBUG to true. Checked my rights everything seems fine. No log file is created and nothing is logged.
So i found out the issue. The issue was that we were using Bugsnag. However Bugsnag was always loaded via a serviceprovider and it tried to write logfiles to production.
So no I solved this by removing the serviceprovider from config/app.php and adding it to the Appserviceprovider like so:
if ($this->app->environment('production')) {
$this->app->register(BugsnagServiceProvider::class);
$this->app->alias('bugsnag.logger', Log::class);
$this->app->alias('bugsnag.logger', LoggerInterface::class);
}
Thanks @IgorBabko for helping me in the right direction.
This just solved my problem. Working on an oss codebase and could not figure out why I couldn't log anything... Wrapped the bugsnag aliases in the env check and good to go.