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

envolt's avatar

Laravel Log not working with few controller function

I'm facing a weird issue.

Please goto Edit-

Suppose I have 6 function in my single controller (which are linked to 6 different routes), Log is just not working for few (randomly, not able to replicate it on my local server).

I've a job (say j1) which is being used from one function (f1), Log is also not working there (neither in f1 or j1).

But if I'm executing Job (j1) from another function (f2, where log is working), Log is working fine in Job as well. (f1 and f2 are part of same controller).

This is happening so randomly, and my Log files are completely messed up, because of this unusual behavior, and worst part I'm not able to debug this one. Log is just not working inside that function, no matter how many time I write Log::info('test'); Any tips, from where should I start debugging this. It's on production, so I can't do anything risky.

EDIT 1 - You can read above whatever is there, issue is not function specific. I've two codes hosted on the same server, one is core PHP, and another is Laravel 5.1. which sometimes communicate using Rest APIs, but I'm facing a weird issue, when ever I'm calling Laravel APIs from code 1, Laravel log is just not working, it's not writing up logs, but whenever RestAPIs are hit outside of server, it's working perfectly fine.

I'm using external communication to hit the APIs (URL Endpoints), if that helps.

Edit 2 - PHP Version if 5.5.27, and I'm able to replicate this. I just tried curl request with same host, and Log didn't work, but from other hosts it is working fine.

0 likes
0 replies

Please or to participate in this conversation.