0

I'd like to have a simple logger as I have in Rails. Just to log all requests with all their parameters. Can's figure out how to do this. Thanks.

Benjamin Harel
  • 2,906
  • 3
  • 24
  • 32

2 Answers2

0

Try

configure do
  enable :logging
end

See http://www.sinatrarb.com/intro.html#Logging

hdgarrood
  • 2,141
  • 16
  • 23
0

Found it:

configure do
  class ::Logger; alias_method :write, :<<; end
  use Rack::CommonLogger, Logger.new('logs/app.log')
end

taken from here: customink/stoplight

Benjamin Harel
  • 2,906
  • 3
  • 24
  • 32