远程服务器日志production.log为空

时间:2017-03-09 10:23:43

标签: ruby-on-rails

问题:log / production.rb文件存在,但在生产Rails 4.2环境中为空。

应用根和权限:

drwxrwxr-x  2 deploy deploy     4096 Mar  7 14:59 .
drwxrwxr-x 21 deploy deploy     4096 Mar  7 04:16 ..
-rw-rw-r--  1 deploy deploy        0 Feb  6 17:13 .git_keep
-rw-rw-r--  1 deploy deploy 95833941 Mar  9 05:16 newrelic_agent.log
-rwxrwxrwx  1 deploy deploy       80 Mar  9 01:16 production.log
-rw-------  1 deploy deploy   129287 Mar  7 08:24 production.searchd.log
-rw-------  1 deploy deploy    93957 Mar  9 05:06 production.searchd.query.log
-rw-------  1 deploy deploy        5 Feb  7 10:37 production.sphinx.pid

配置/环境/ production.rb

# If you have no front-end server that supports something like X-Sendfile,
  # just comment this out and Rails will serve the files
  config.log_level = :info
  # Basic log config, for calls to Rails.logger.<level> { <message> }
  config.logger = Logger.new('log/production.log')
  # Formats log entries into: LEVEL MESSAGE
  # Heroku adds to this timestamp and worker/dyno id, so datetime can be stripped
  config.logger.formatter = ->(severity, datetime, progname, msg) { "#{severity} #{msg}\n" }

  # Lograge config, overrides default instrumentation for logging ActionController and ActionView logging
  config.lograge.enabled = true

请帮助。谢谢你提前

0 个答案:

没有答案