Almaz - A rack middleware that logs to Redis

Almaz

You know what really grinds my gears: looking through log files. Especially when you have 3 slices running all having their own separate logs! Grrrrr. Introducing Almaz!

http://github.com/jpoz/almaz

An exact copy of the 1960s Soviet Union spy satellite, written in Ruby! Almaz has two parts: Almaz::Capture and Almaz::View.

Almaz::Capture:

  1. Counts all requests going to your server.
  2. Records the URL.
  3. Records the params.

Almaz::View:

  1. Show you the statistics.
  2. Provides basic authentication.

All the data is stored in Redis! And all the code for Almaz is in one file (including the view to show the statistics).

Example:

Here’s a super basic Sinatra app. Almaz has been copied into the app’s directory

Usage:

Let your users run wild. Almaz will be watching everything, even request that you don’t have a route for. Then go to yoursite.com/stats, type in your username and password and you can see all the stats for your site.

Notes:

This has not been performance tested or scaled up in any means. So don’t use it in production… yet :-)

blog comments powered by Disqus