Hi all.
I have managed to run two laravel applications on a load balancer so every one of them has its own log file .
reading and searching throw the two files is very hard. Is there a way to register the logs into one single file?
notes: I don't want to register the log to the database cuz the data is huge the files are the ideal way.
You can try put the log directory on a mounted network share that way it will be centralized, however be aware the you might get issues with the file being locked by the other server.
@Tray2
Thanks a lot for the resource I have enjoyed reading through this subject (NFS ).
so, I have a little note about what I learned.
NFS is perfect for sharing storage across servers and clients but when clients open files then it will be locked till finished ! in my case, I'm developing a system that may have hundreds of thousands of requests per day and in every request, there is a lot to log ! which means this issue will be a bottleneck for me π£.
is there another way of doing that !!
@alnouirah Laravel has support for many logging providers. Open up your config/logging.php file. You can use something like Papertrail, or Bugsnag, or Sentry, to pipe logs to one central location.
Hello all,
The reason why I want to centralize the log to a single file is for debugging by using this package ARCANEDEV-LogViewer. so all the solutions mentioned above didn't work for me. Even after doing a massive search about this subject, I didn't find the solution I want.
Thanks all for your help and suggestions.