How to view debug code in Thin console window?

2020-07-17 08:11发布

In Mongrel, we are able to see any ruby debug code. After installing thin and doing thin start. I don't see any debug code on the console window.

Is this nromal?

Are we supposed to use tail -f log/development.log in a new console window to view the debug code?

4条回答
孤傲高冷的网名
2楼-- · 2020-07-17 08:41

Yes. The solution with tail is normal, and you should use it.

查看更多
甜甜的少女心
3楼-- · 2020-07-17 08:43

You could also try to start your server this way :

rails server thin

It shows your log, in Rails 3 at least.

查看更多
地球回转人心会变
4楼-- · 2020-07-17 08:50

You can use a Procfile with foreman:

Procfile

web: thin start -p $PORT
logger: tail -f log/development.log

Example

$ foreman start -p 3000
查看更多
唯我独甜
5楼-- · 2020-07-17 08:53

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

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

查看更多
登录 后发表回答