I wrote a custom module, which logs errors to an external text file. The files are kept in
/sites/all/modules/custom/my_module/logging/
The problem is, if the user know the name of the file, they can go directly to it. For example, if they go to:
http://localhost/MySite/web/sites/all/modules/custom/my_module/logging/
The will get a forbidden error. But, if they know the name of the document and go to:
http://localhost/MySite/web/sites/all/modules/custom/my_module/logging/myFile.txt
the full file is rendered to the browser. Is there a way to prevent this? Ideally, I would like to show the files to certain users but at the very least prevent it all together.