Answer the question
In order to leave comments, you need to log in
How to write data to the log?
Subject.
On the one hand, the answer is obvious - file_put_contents with FILE_APPEND, but conflicts may arise when writing by different processes.
I don't want to write to the database.
How is this issue resolved in web servers? Is there a separate logging daemon? Is it possible to use it somehow from PHP?
Answer the question
In order to leave comments, you need to log in
The standard monologue handler uses flock and LOCK_EX
Monolog/Handler/StreamHandler.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question