2012-05-31 57 views
1

我遇到了麻煩,發現我的應用程序無法工作的原因。我正在使用apache +乘客。Rails生產日誌 - 有時會記錄請求,有時候不會記錄

# config/environments/production.rb 
config.log_level = :debug 

問題是有時候請求被記錄,有時候不是。

I.E.

Request: GET /a/b 

# tail -f /var/log/httpd/error_log 
cache: [GET /a/b] miss 

# tail -f log/production.l 
Started GET "https://stackoverflow.com/a/b" for 189... 

ActionController::RoutingError (No route matches [GET] "https://stackoverflow.com/a/b"): 
[... stack trace ...] 

不錯。這正是我期望在日誌中看到的。但第二次嘗試同樣的請求(從另一個瀏覽器中排除任何本地緩存)時,我在apache錯誤日誌中看到相同的輸出,但production.log未更改。

如果我嘗試不同的請求,我可以在兩個日誌中看到輸出。

Request: GET /a/b/c 

# tail -f /var/log/httpd/error_log 
cache: [GET /a/b/c] miss 

# tail -f log/production.l 
Started GET "https://stackoverflow.com/a/b/c" for 189... 

ActionController::RoutingError (No route matches [GET] "https://stackoverflow.com/a/b/c"): 
[... stack trace ...] 

看起來像有一個緩存不會記錄「冗餘」的警告和錯誤。

那麼,問題是,我該如何記錄一切?

TIA。

回答