Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails生产日志不更新_Ruby On Rails_Ruby On Rails 6 - Fatal编程技术网

Ruby on rails Rails生产日志不更新

Ruby on rails Rails生产日志不更新,ruby-on-rails,ruby-on-rails-6,Ruby On Rails,Ruby On Rails 6,我使用的是Rails 6.0.3 在生产中,我尝试在生产日志上运行tail-f,在应用程序上执行任何操作时,我都不会收到更新。有什么想法吗 我试图对production.log文件应用0644权限,但这不是问题所在,因为文件中有数据 我也在使用nginx和puma 生产日志: 生产日志文件权限 -rw-rw-r-- 1 ubuntu ubuntu 733 Apr 25 11:44 production.log production.rb Rails.application.configu

我使用的是Rails 6.0.3

在生产中,我尝试在生产日志上运行tail-f,在应用程序上执行任何操作时,我都不会收到更新。有什么想法吗

我试图对production.log文件应用0644权限,但这不是问题所在,因为文件中有数据

我也在使用nginx和puma

生产日志:

生产日志文件权限

-rw-rw-r--  1 ubuntu ubuntu  733 Apr 25 11:44 production.log
production.rb

Rails.application.configure do
  # Settings specified here will take precedence over those in config/application.rb.

  # Code is not reloaded between requests.
  config.cache_classes = true

  # Eager load code on boot. This eager loads most of Rails and
  # your application in memory, allowing both threaded web servers
  # and those relying on copy on write to perform better.
  # Rake tasks automatically ignore this option for performance.
  config.eager_load = true

  # Full error reports are disabled and caching is turned on.
  config.consider_all_requests_local       = false

  # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
  # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
  # config.require_master_key = true

  # Disable serving static files from the `/public` folder by default since
  # Apache or NGINX already handles this.
  config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

  # Store uploaded files on the local file system (see config/storage.yml for options).
  config.active_storage.service = :local

  config.cache_store = :redis_cache_store, { url: "redis://localhost:6379/0" }

  # Mount Action Cable outside main process or domain.

  .....

  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  # config.force_ssl = true

  # Use the lowest log level to ensure availability of diagnostic information
  # when problems arise.
  config.log_level = :debug

  # Prepend all log lines with the following tags.
  # config.log_tags = [ :request_id ]

  # Use a different cache store in production.
  # config.cache_store = :mem_cache_store


  config.action_mailer.perform_caching = false

  # Ignore bad email addresses and do not raise email delivery errors.
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
  # config.action_mailer.raise_delivery_errors = false

  ............

  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation cannot be found).
  config.i18n.fallbacks = true

  # Send deprecation notices to registered listeners.
  config.active_support.deprecation = :notify

  # Use default logging formatter so that PID and timestamp are not suppressed.
  config.log_formatter = ::Logger::Formatter.new

  # Do not dump schema after migrations.
  config.active_record.dump_schema_after_migration = false

end

提前感谢。

我通过将以下行添加到生产文件中解决了问题: config.logger=logger.new(Rails.root.join(“log/production.log”))

并在生产服务器上重新启动cougar