10

Thin server has -l option to redirect output to log file (default: log/thin.log). Is there a way like in webrick server the output is always to console (and log/development.log) too ?

Daya Sharma
  • 2,855
  • 2
  • 15
  • 12

5 Answers5

3

My installed version of Thin automatically outputs to the console. If yours doesn't, you could try updating your installed version.

You could also try thin -l -, which tells Thin to redirect output to STDOUT.

Hope this helps!

ligfx
  • 446
  • 2
  • 8
2

If you're using rails, add this to your gemfile:

gem 'thin', :group => 'development'

And then from the console, use:

rails s

This will send logs to standard out and to log/development.log

Don't use "thin start", as some of the docs say.

THEM
  • 204
  • 1
  • 4
0

I use thin start -d to start thin as a background daemon with default logging and send the output of the file back to console with

tail -f log/thin.log

This way the server doesn't stop if terminal closes, but I can see output from puts statements. If you want more detailed logging from thin that's a bit different.

To stop the service/daemon use thin stop

James EJ
  • 1,955
  • 1
  • 18
  • 16
0

The solution is to add a small code snippet in your config.ru file, and thin output all app logs to the console, without having to tail the log file and it keeps the log coloring intact

Details here: Thin server: Thin server: ouput rails application logs to console, as 'rails s' does

Community
  • 1
  • 1
Benjamin Bouchet
  • 12,971
  • 2
  • 41
  • 73
0

Mine does automatically output into console however if I use a Procfile, it doesn't.

oky_sabeni
  • 7,672
  • 15
  • 65
  • 89