2015-10-14 45 views
1

我一直在嘗試使用Docker進行開發,它工作得很好,但其中一個讓我惱火的事情是無法看到控制檯打印。在Ruby on Rails中使用Docker時不出現控制檯打印

Rails的服務器(完全一樣的應用程序):

Started GET "/" for ::1 at 2015-10-14 22:18:28 +0200 
Processing by PagesController#home as HTML 
foobar 
Rendered pages/home.html.erb within layouts/home (0.0ms) 
Completed 200 OK in 20ms (Views: 19.7ms | ActiveRecord: 0.0ms) 

泊塢窗:

Started GET "/" for 192.168.99.1 at 2015-10-14 20:18:44 +0000 
Processing by PagesController#home as HTML 
Rendered pages/home.html.erb within layouts/home (0.1ms) 
Completed 200 OK in 179ms (Views: 177.6ms | ActiveRecord: 0.0ms) 

這些日誌是從我的容器內尾礦日誌/ development.log文件。

有沒有其他人遇到過這個?如何解決這個問題?乾杯!

+0

也許這有幫助嗎? http://serverfault.com/a/634296/783 – VonC

回答

1

我注意到,這不是Docker與拖拽非Docker項目相關的東西。使用WEBrick時,日誌工具(如putsprint)將顯示在您的控制檯中,但未添加到日誌文件中。

解決方法是使用logger.info()代替。

相關問題