I have a piece of code in most of my functions for logging purpose now on production and we see a logs files of 2gb per day is it okay to write directly to log files using file_put_contents. We are speculating this file_get_contents will become a blocking point as this size and traffic increases. Can someone guide me a proper way to do logging in physical files without blocking php. Any other approach is most welcomed.
file_put_contents(
getcwd() . "debug_log.txt",
"" . print_r($updateFieldsArray, true) . "\n",
FILE_APPEND | LOCK_EX
);
Thanks in advance.