I have an API which write logs for every requests. There is also another background task that is running always and uses same logger for logging errors etc. As this process is always running and have a reference to the file, the API actually never gets the permission to write there.
I am using monolog for as logger with 'StreamHandler' handler.
My goal is to use this same log file from both process. How can I achieve it? Is there any easy way with monolog to release access lock on the file after writing something and gain it again just before writing? Thanks.