Since I announced rails-log-analyzer some weeks ago, quite a lot has happened! Apparently there is some interest in such a tool: on this blog we get a lot of traffic looking for more info, the github project already has 22 watchers and it even has been forked!
In the mean time, Bart and I worked hard to add new functionality and refactored the internal design. As a result, I have released request-log-analyzer 0.1.0 today!
Changes:
- The project is renamed to request-log-analyzer, because we plan to support log files from other frameworks as well; Merb is planned to be supported in the near future.
- The tool is distributed as a gem, making it much easier to install and update.
- More reports, colorized output, parsing progress bars, command line arguments, etc…
- Added a tool to create a SQLite database with all the parsed info from the log file, so you can do your own analysis.
Installation:
gem sources -a http://gems.github.com sudo gem install wvanbergen-request-log-analyzer
Usage:
request-log-analyzer [LOG FILES*] request-log-analyzer -c 20 -z log/production.log
Please let me know what you think! If you have any problems using the tool, do not hesitate to contact me!
Tags: "rails-log-analyzer", Logger, production.log, request-log-analyzer, statistics



August 29th, 2008 at 12:09 pm
[...] Original post by Willem van Bergen [...]
October 8th, 2008 at 11:39 am
Hey,
can you describe how to run your gem with windows?
A simple request-log-analyzer [LOG FILES*] on the windows command prompt will not work.
Thanks in advance!
October 16th, 2008 at 12:14 pm
Sorry for the late reply; I was on a holiday.
Unfortunately, I don’t have a Windows installation to test it on: you may be the first person to use this tool on Windows
. What error message do you get when you run request-log-analyzer?
You may need to call the Ruby interpreter directly, because Windows does not support the executable file permission, but you’ll need to find out where the request-log-analyzer file is installed on your system:
ruby c:\path\to\request-log-analyzer c:\railsapp\log\development.logHope this helps!
November 10th, 2008 at 1:17 pm
I’m trying to intall this with windows.Not sure if i’m trying to install it right – gem sources -a http://gems.github.com
sudo gem install wvanbergen-request-log-analyzer
please advice..
thanks
November 10th, 2008 at 5:49 pm
The commands you posted works for me. However, I only have used the tool on OSX and Linux and I have never used in in Windows, so it might not even work for you at all.
Can you post the error message you are experiencing? Any additional information you can provide might help me solving this issue.
December 11th, 2008 at 6:37 am
Does this work with rails 2.1? As I tried this out with rails 2.1 production log, it gave ‘Unparsable completed line: Completed in 10ms (View: 0, DB: 3) | 200 OK [http://mywebsite.com/] for all lines parsed. With development log, it could parse only some lines.
December 11th, 2008 at 11:20 am
As of yet, it does not work with this new log format. I am working on making request-log-analyzer compatible, because we need it for Floorplanner as well. I will release an update in the upcoming days, so keep an eye on the github project.
December 11th, 2008 at 1:47 pm
I have made the necessary changes to support the new log format.
You can find them in the rails22 branch of the github project. After some testing, I will merge the changes to the master branch and publish an updated gem.
January 25th, 2009 at 5:49 pm
Willem,
This is a really excellent tool! Well done and thanks for sharing.
Cheers,
Mark
January 25th, 2009 at 10:59 pm
Hey Mark, glad you like it! Don’t hesitate to contact me if you have any questions.
February 27th, 2009 at 10:09 am
I have the the Request-log-analyzer version 1.1 (and 1.1.5.1) installed and it seems to mix up the view times with the DB times for my rails 2.2 app
Database time – I have the following entry
DownloadsController#report.xml [P ┃ 302 ┃ 0.00s ┃ 0.00s ┃ 0.00s ┃ 0.00s
View rendering time - I see the following entry
DownloadsController#report.xml [ ┃ 302 ┃ 300.15s ┃ 0.99s ┃ 0.00s ┃ 12.45s
But if I grep the log file, the only reference to 12.45 seconds I can find is the following:
Completed in 12458ms (View: 0, DB: 12451) | 200 OK [http://publisher.peerialism.com/downloads/report.xml]
So the times seems to be mixed up
Cheers,
Nils
February 27th, 2009 at 11:02 am
Nice catch! I looked it up in the code, and I found that the titles above these tables are switched. Internally, the values are parsed correctly. I will fix this mistake this weekend.
February 28th, 2009 at 12:32 pm
It has been fixed. Please upgrade to version 1.1.6 to have the correct table headers names in your report.