Tôi tin rằng hành vi mặc định của ghi nhật ký trên đường ray trong sản xuất là không xuất kết quả của tất cả các partials. Điều này nên đăng nhập vào phát triển nhưng không đăng nhập vào sản xuất.Ẩn hiển thị các partials từ nhật ký đường ray
Tuy nhiên, tôi thấy điều này trong quá trình sản xuất và tôi không chắc chắn cách xóa. Nhật ký của tôi quá ồn ào. Môi trường sản xuất của tôi là Heroku chạy Unicorn và sử dụng Papertrail để xem nhật ký của tôi. Tôi biết Unicorn làm một số công cụ rung rinh với các bản ghi và để chúng hoạt động bình thường ở nơi đầu tiên tôi đã để thêm video này production.rb tôi:
config.logger = Logger.new(STDOUT)
config.logger.level = Logger.const_get('INFO')
(Giải thích ở đây: http://help.papertrailapp.com/kb/configuration/unicorn)
Nhưng ngay cả với log_level INFO tôi nhìn thấy khối khổng lồ này trong tất cả các bản ghi của tôi:
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_caption.html.erb (0.7ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_rights.html.erb (2.1ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_category.html.erb (4.8ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_caption.html.erb (0.3ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_rights.html.erb (0.4ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_category.html.erb (4.4ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_caption.html.erb (0.3ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_rights.html.erb (0.3ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_category.html.erb (1.8ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_caption.html.erb (0.4ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_rights.html.erb (4.6ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_category.html.erb (2.1ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_caption.html.erb (0.3ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_rights.html.erb (0.4ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_category.html.erb (4.1ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_caption.html.erb (0.2ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_rights.html.erb (1.8ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_category.html.erb (6.0ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_caption.html.erb (0.5ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_rights.html.erb (0.8ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_category.html.erb (1.9ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_caption.html.erb (0.3ms)
Jun 25 22:15:15 tacktile app/web.1: Rendered photos/pieces/_rights.html.erb (0.7ms)
Có bạn đã hoàn thành 'heroku config: thêm LOG_LEVEL =" info "'? – David
David, vâng. Và tôi đã thử thiết lập nó tại "gỡ lỗi" vs "thông tin" để xác nhận rằng sự thay đổi độ dài. Thật vậy nó. Nhưng ngay cả ở cấp độ "thông tin", tôi vẫn nhận được tất cả các câu lệnh trả về. Tôi chắc rằng tôi có thể biến nó xuống sâu hơn và giấu chúng đi. Nhưng sự rầm rộ là tuyệt vời * ngoại trừ * đối với những câu trả lời "kết xuất" này cho tất cả các partials. Tôi muốn tìm ra cách để che giấu những thứ đó. –
Xem thêm câu trả lời này: http://stackoverflow.com/a/12003652/514483 – robd