|
4 | 4 | # Settings specified here will take precedence over those in config/application.rb. |
5 | 5 |
|
6 | 6 | # Code is not reloaded between requests. |
7 | | - config.enable_reloading = false |
| 7 | + config.cache_classes = true |
8 | 8 |
|
9 | 9 | # Eager load code on boot. This eager loads most of Rails and |
10 | 10 | # your application in memory, allowing both threaded web servers |
|
13 | 13 | config.eager_load = true |
14 | 14 |
|
15 | 15 | # Full error reports are disabled and caching is turned on. |
16 | | - config.consider_all_requests_local = false |
| 16 | + config.consider_all_requests_local = false |
17 | 17 | config.action_controller.perform_caching = true |
18 | 18 |
|
19 | | - # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment |
20 | | - # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). |
| 19 | + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] |
| 20 | + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). |
21 | 21 | # config.require_master_key = true |
22 | 22 |
|
23 | | - # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. |
24 | | - # config.public_file_server.enabled = false |
| 23 | + # Disable serving static files from the `/public` folder by default since |
| 24 | + # Apache or NGINX already handles this. |
| 25 | + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? |
25 | 26 |
|
26 | 27 | # Compress CSS using a preprocessor. |
27 | 28 | # config.assets.css_compressor = :sass |
28 | 29 |
|
29 | | - # Do not fall back to assets pipeline if a precompiled asset is missed. |
| 30 | + # Do not fallback to assets pipeline if a precompiled asset is missed. |
30 | 31 | config.assets.compile = false |
31 | 32 |
|
32 | 33 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. |
|
44 | 45 | # config.action_cable.url = "wss://example.com/cable" |
45 | 46 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] |
46 | 47 |
|
47 | | - # Assume all access to the app is happening through a SSL-terminating reverse proxy. |
48 | | - # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. |
49 | | - # config.assume_ssl = true |
50 | | - |
51 | 48 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. |
52 | | - config.force_ssl = true |
| 49 | + # config.force_ssl = true |
53 | 50 |
|
54 | | - # Log to STDOUT by default |
55 | | - config.logger = ActiveSupport::Logger.new(STDOUT) |
56 | | - .tap { |logger| logger.formatter = ::Logger::Formatter.new } |
57 | | - .then { |logger| ActiveSupport::TaggedLogging.new(logger) } |
| 51 | + # Include generic and useful information about system operation, but avoid logging too much |
| 52 | + # information to avoid inadvertent exposure of personally identifiable information (PII). |
| 53 | + config.log_level = :info |
58 | 54 |
|
59 | 55 | # Prepend all log lines with the following tags. |
60 | 56 | config.log_tags = [ :request_id ] |
61 | 57 |
|
62 | | - # "info" includes generic and useful information about system operation, but avoids logging too much |
63 | | - # information to avoid inadvertent exposure of personally identifiable information (PII). If you |
64 | | - # want to log everything, set the level to "debug". |
65 | | - config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") |
66 | | - |
67 | 58 | # Use a different cache store in production. |
68 | 59 | # config.cache_store = :mem_cache_store |
69 | 60 |
|
70 | 61 | # Use a real queuing backend for Active Job (and separate queues per environment). |
71 | | - # config.active_job.queue_adapter = :resque |
72 | | - # config.active_job.queue_name_prefix = "testproject_production" |
| 62 | + # config.active_job.queue_adapter = :resque |
| 63 | + # config.active_job.queue_name_prefix = "sample_rails_2_production" |
73 | 64 |
|
74 | 65 | config.action_mailer.perform_caching = false |
75 | 66 |
|
|
84 | 75 | # Don't log any deprecations. |
85 | 76 | config.active_support.report_deprecations = false |
86 | 77 |
|
| 78 | + # Use default logging formatter so that PID and timestamp are not suppressed. |
| 79 | + config.log_formatter = ::Logger::Formatter.new |
| 80 | + |
| 81 | + # Use a different logger for distributed setups. |
| 82 | + # require "syslog/logger" |
| 83 | + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") |
| 84 | + |
| 85 | + if ENV["RAILS_LOG_TO_STDOUT"].present? |
| 86 | + logger = ActiveSupport::Logger.new(STDOUT) |
| 87 | + logger.formatter = config.log_formatter |
| 88 | + config.logger = ActiveSupport::TaggedLogging.new(logger) |
| 89 | + end |
| 90 | + |
87 | 91 | # Do not dump schema after migrations. |
88 | 92 | config.active_record.dump_schema_after_migration = false |
89 | | - |
90 | | - # Enable DNS rebinding protection and other `Host` header attacks. |
91 | | - # config.hosts = [ |
92 | | - # "example.com", # Allow requests from example.com |
93 | | - # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` |
94 | | - # ] |
95 | | - # Skip DNS rebinding protection for the default health check endpoint. |
96 | | - # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } |
97 | 93 | end |
0 commit comments