Rails生产日志 - 有时会记录请求,有时不会记录

时间:2012-05-31 19:03:44

标签: ruby-on-rails-3 caching logging

我很难找到我的申请无法运作的原因。我正在使用apache + passenger。

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

问题有时会记录请求,有时不记录。

Request: GET /a/b

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

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

ActionController::RoutingError (No route matches [GET] "/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 "/a/b/c" for 189...

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

看起来有一个缓存不会记录"冗余"警告和错误。

嗯,问题是,如何记录所有内容?

TIA。

1 个答案:

答案 0 :(得分:0)