Cakephp 3 Write log issue

When writing custom logs in another folder and files, it doesn’t write and produces error which is logged in error.log file.
When i give 777 permission to the folder/file then it writes.
I have also encountered some different issues in logs, it is writing logs for some request but for another request it generates write permission issues and this continues for all the requests.

Please help.
I would be very thankful for your precious time on giving this resolution.

Thank you.

Hello,

Have you put an entry for each log in your configuration file ?

regards,

Yes I have created separate log config as defined in error and debug logging in app config.
I have read doc and I am not sure that is there any role of mask in log permission?