Prevent /shared/log/rails/production.log


I found, that in our environment there is a production.log written at /shared/log/rails/production.log

Is there a way to prevent writing this log?


Might I ask, why do you want to prevent the log?

You can look at templates/web.template.yml to see how the logs get trimmed, and perhaps from there get a hint about how to configure NGINX to not keep the logs (see How to disable Nginx logging? - Server Fault for an example of what NGINX needs).

You’d either create another template to do that or insert a few lines in your app.yml to do the same thing.



Thanks for you quick answer. Will dig into that.

It should be possible to disable this log as an easy way to prevent running out of disk space.

In my case I see the log responds to pointless malicious access attempts - perhaps that’s not useful and can be reconfigured not to happen?

ActionController::RoutingError (No route matches [HEAD] "/passwords.txt")
ActionController::RoutingError (No route matches [GET] "/.env")

That log automatically rotates and compresses. If that single text file is the difference between running out of storage space and not, you may have a larger problem.


Good to know. Thanks