Rails production log not updating
I’ll show you how to turn several lines of rambling output per request into one concise line with the essential information that needed to debugging production problems.This will be the basis for adding logging specific to your business logic and future debugging requirements.The five lines in the above example for a single 404 error are fairly typical of what you’ll see for all requests in a production log.There are a number of problems that are immediately apparent: and it is easy to add your own logging to your application.We can add this to our Note here that we’re removing certain parameters that could be inferred from the requests path, again to keep the clutter out of our log file.Also we format the http method to a fixed width so that the remaining information will line up in columns and we preface the parameters with method is necessary because we aren’t given a status in the event payload if an exception has occurred during the processing of the request.In this article I’m assuming a relatively simple Rails application at the beginning of its lifecycle that runs as a single instance.The application might have a handful of standard RESTful resources with their initial generated routing.
To create the catch-all route, add this line to the end of your It’s important that this be the last rule in your routes file as it will route all requests that aren’t matched by a previously defined route and anything you put after this rule will be ignored.
However, everything seems to be being written to /var/log/apache2/
I’ve seen some very effective use of application logging to debug difficult problems.
Rather than log all information about a particular request on multiple lines it will be much easier for later processing if we have a one line format.
For the humans it works best to keep things lined up neatly in columns so that they can be quickly scanned for anomalous entries.