Last Updated: February 25, 2016
· gus

Logging exceptions on Sinatra

Simply debugging an application in Sinatra it's a bit of a headache. Logging in particular was being kinda troublesome in our Passenger stack.

I've found out the following approach to solve the logging issue for us.

log_file ="#{settings.root}/log/#{settings.environment}.log", 'a+')


STDOUT.sync = true
STDERR.sync = true

Worth checking, the sinatra recipes website.