Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sandersjj's avatar

Laravel not logging anyting

Hello,

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.

I have done so many things to get this working:

php artisan optimize
chmod 755 storage -R
php artisan clear:cache

But it just doesn't work. Looking for the golden suggestion. Thanks.

0 likes
5 replies
IgorBabko's avatar

Could you just provide more info on how you try to log smth. Did you install any third party service providers? And also can you show your log config?

I'm talking about these vars:

'log' => env('APP_LOG', 'single'),

'log_level' => env('APP_LOG_LEVEL', 'debug'),

@dubbeltje Can you also show the line, where you log info in controller method or route closure.

1 like
IgorBabko's avatar

@dubbeltje Did you install any third party service providers? Please, show your log statement in the controller method or route closure.

1 like
sandersjj's avatar
sandersjj
OP
Best Answer
Level 4

Ok Guys,

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.

1 like
quickliketurtle's avatar

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.

Thanks @dubbeltje :-)

Please or to participate in this conversation.