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 ?
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!
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.
Mine does automatically output into console however if I use a Procfile, it doesn't.
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
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
© 2022 - 2024 — McMap. All rights reserved.
enable :logging
. – Pommard