Skip to content

Instantly share code, notes, and snippets.

@FUT
Created June 4, 2013 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FUT/5706623 to your computer and use it in GitHub Desktop.
Save FUT/5706623 to your computer and use it in GitHub Desktop.
Sinatra logging
before do
# if using shotgun, create a custom log format
!settings.shotgun || begin
logger.class_eval do
cattr_accessor :format
self.format = <<-TEXT
#{Time.now}
#{request.request_method} #{request.fullpath}
Content-Length: #{request.content_length}
Params: #{request.params}
TEXT
end
logger.info logger.format
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment