WebFaction
Community site: login faq

I have created a Passenger/Ruby application in the control panel. I need to have logging enabled for my Sinatra app:

class Application < Sinatra::Base
    configure {                                                                 
      enable :logging                                                           
    }

    get '/' do
      logger.info 'hello log'      
      "hello world"
    end                                                                         
end

where are the logged messaged should appear? How do I view them? There is nothing in the error log for my app.

asked 23 Apr '13, 11:49

akonsu
64514
accept rate: 100%


I had to create a logger myself:

configure {
  enable :logging
}
before {
  env['rack.logger'] = Logger.new "#{settings.root}/log/#{settings.environment}.log"
}
get '/' do
  logger.info 'hello log'
  "hello world"
end
permanent link

answered 26 Apr '13, 13:06

akonsu
64514
accept rate: 100%

I think you should be looking in ~/webapps/name_of_app/name_of_project/log/production.log.

If not there, then please try ~/webapps/name_of_app/nginx/logs/error.log.

Hope that helps!

permanent link

answered 23 Apr '13, 18:46

seanf
12.2k42136
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×81
×9

question asked: 23 Apr '13, 11:49

question was seen: 4,664 times

last updated: 26 Apr '13, 13:06

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM