We anaylze production logs time to time. There are many gems/tools available for it. But i found request-log-analyzer a good tool to use. To install this gem use
If you want to analyse completly(without any custom option) just run this command:
This generates a detailed report having these informations:
1.Request distribution per hour
2.Most requested actions
3.HTTP methods(get,post etc.) usage
4.Duration a request is taking with thier mean and deviation
5.Partial/View rendering time.
6.Routing errors etc.
Now say, You log the data when you make an api call from your app. Your log format is like this:
Calling API [api_name] at [time]
Now you want to check how many times a particular api is being called. Request Log Anaylser provides custom formats to anaylse this type of logs.
Create a file named [filename].rb and paste this code into our file.
Now to use this custom format use command line:
This will generate the full report and append the report related to our custom format at last.comments powered by Disqus