I have the following Sinatra 1.2.1 application code:
# app.rb require 'sinatra' get '/' do logger.info "COUCOU" 'Hello world!' end
and start the server using ruby -rubygems app.rb When I go to http: // localhost: 4567 , I get the error message:
NameError at / undefined local variable or method `logger' for #<Sinatra::Application:0x00000100d91f88> file: app.rb location: block in <main> line: 4
Do I need to add or configure something to enable logging in Sinatra? By reading the Sinatra README and the documentation, it seems that logging is enabled by default for Sinatra::Application .
source share