production.rb 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. require "active_support/core_ext/integer/time"
  2. Rails.application.configure do
  3. # Settings specified here will take precedence over those in config/application.rb.
  4. # Code is not reloaded between requests.
  5. config.cache_classes = true
  6. # Eager load code on boot. This eager loads most of Rails and
  7. # your application in memory, allowing both threaded web servers
  8. # and those relying on copy on write to perform better.
  9. # Rake tasks automatically ignore this option for performance.
  10. config.eager_load = true
  11. # Full error reports are disabled and caching is turned on.
  12. config.consider_all_requests_local = false
  13. config.action_controller.perform_caching = true
  14. # Disable serving static files from the `/public` folder by default since
  15. # Apache or NGINX already handles this.
  16. config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
  17. # Include generic and useful information about system operation, but avoid logging too much
  18. # information to avoid inadvertent exposure of personally identifiable information (PII).
  19. config.log_level = :info
  20. # Prepend all log lines with the following tags.
  21. config.log_tags = [ :request_id ]
  22. # Use a different cache store in production.
  23. config.cache_store = :memory_store
  24. # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  25. # the I18n.default_locale when a translation cannot be found).
  26. config.i18n.fallbacks = true
  27. # Send deprecation notices to registered listeners.
  28. config.active_support.deprecation = :notify
  29. # Log disallowed deprecations.
  30. config.active_support.disallowed_deprecation = :log
  31. # Tell Active Support which deprecation messages to disallow.
  32. config.active_support.disallowed_deprecation_warnings = []
  33. # Use default logging formatter so that PID and timestamp are not suppressed.
  34. config.log_formatter = ::Logger::Formatter.new
  35. # Use a different logger for distributed setups.
  36. # require "syslog/logger"
  37. # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
  38. if ENV["RAILS_LOG_TO_STDOUT"].present?
  39. logger = ActiveSupport::Logger.new(STDOUT)
  40. logger.formatter = config.log_formatter
  41. config.logger = ActiveSupport::TaggedLogging.new(logger)
  42. end
  43. # Do not dump schema after migrations.
  44. config.active_record.dump_schema_after_migration = false
  45. end