A
A
Alexander2020-08-13 01:44:26
PHP
Alexander, 2020-08-13 01:44:26

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

2 answer(s)
D
Daria Motorina, 2020-08-13
Madzhugin @Suntechnic

The standard monologue handler uses flock and LOCK_EX Monolog/Handler/StreamHandler.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question