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

Th3apprenTis's avatar

Logging in laravel

My use case is logging some info for every request .in my application.How does laravel logging works in terms of performance?.I am currently using a queue and inside the handle i write log to a file as follows:

\Log::channel('BrowsingLogs')->info($this->single_log);

i am thinking of using redis as a buffer and then write to disk every X request to avoid IO issue but it may be overkill.Also is it a good practice to put Log::info in production?

0 likes
2 replies
RoboRobok's avatar

Yes, putting Log::info() in production can be useful in some cases. It all depends what kind of data you want to collect.

kobear's avatar

Can this info be discerned from the nginx/apache log files? If it can, then it is best to let request logging be done there.

If the data you want cannot be obtained there, then definitely decouple the logging action from your session views.

Log::info is fine in moderation. I would not have it all over the place in a production application.

Please or to participate in this conversation.