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。