Search code examples
ruby-on-rails-4thin

How to make `thin` webserver print log to STDOUT


Context: To run localhost as SSL, I followed the instructions at this site

After setting up the SSL cert, to run the local rails server, the site says to:

thin start --ssl <some more options>

When I do that, I notice that I no longer see the Rails log being printed to STDOUT.

How can I pass the --ssl and other options to thin ? This does not work:

bundle exec rails s thin --ssl

.../rails/commands/server.rb:33:in `parse!': 
    invalid option: --ssl (OptionParser::InvalidOption)

Alternatively, how can I get thin to output the Rails log to STDOUT?


Solution

  • i think that you need to tell rails to use STDOUT for logging instead of logging to log/development.log by putting config.logger = Logger.new(STDOUT) in your app/config/environments/development.rb.