Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fixed: typo.

latest commit 1b789a7c33
da99 authored
Failed to load latest commit information.
lib Bump version patch: 0.1.2
spec Fixed: :skip can be a String or Time object.
Gemfile First commit: Gem created.
Http_Error_Log.gemspec Fixed: typo.
LICENSE Added: LICENSE Fixed: missing keys.


A Ruby gem to turn an error log (eg Nginx error.log) into Ruby data structures:

2012/01/01 01:01:01 [error] 11563#0: *183 connect() failed (111: Connection refused) while connecting to upstream, client:, server:, request: "GET /stylesheets/en-us/, , .css?time=1286211794 HTTP/1.1", upstream: "", host: "", referrer: ""

# ->
[ { :created_at=>Time, :upstreatm=>String, ...} ]


gem install Http_Error_Log


require "Http_Error_Log"

Http_Error_Log "/my/nginx/error.log"
# -->  [ Hash, Hash, Hash ]

Each Hash object has:

:created_at  => Time.parse(str)  # Time object.
:msg         => "*183 connect() failed (111: Connection refused) while connecting to upstream"
:error       => "[error] 11563#0"
:line        => 5                 # line number in file

# plus the other fiends in the file:
#  :upstream, :server, :request, etc.

Skip records using a date/time string:

Http_Error_Log "err.log", '2012/04/04 04:04:04'

# --> Skips records that are less OR equal to:
#     '2012/04/04 04:04:04'

Run Tests

git clone
cd Http_Error_Log
bundle update
bundle exec bacon spec/lib/main.rb

"I hate writing."

If you know of existing software that makes the above redundant, please tell me. The last thing I want to do is maintain code.

Something went wrong with that request. Please try again.