diff --git a/config/application.rb b/config/application.rb index 8903479a..8d52e906 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,7 +22,7 @@ module CodeOcean # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - config.time_zone = 'UTC' + config.time_zone = ENV.fetch('RAILS_TIME_ZONE', 'UTC') # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] diff --git a/config/environments/production.rb b/config/environments/production.rb index 4e6af6dd..e7826ec0 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -54,7 +54,7 @@ Rails.application.configure do # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). - config.log_level = :info + config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info').to_sym # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid, :request_id ] diff --git a/config/environments/staging.rb b/config/environments/staging.rb index bf50b877..71ab3707 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -69,7 +69,7 @@ Rails.application.configure do # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). - config.log_level = :info + config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info').to_sym # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid, :request_id ] diff --git a/docs/environment_variables.md b/docs/environment_variables.md index b75965b5..5579a733 100644 --- a/docs/environment_variables.md +++ b/docs/environment_variables.md @@ -9,8 +9,10 @@ The following environment variables are specifically support in CodeOcean and ar | `SENTRY_DSN` | ` ` | Specifies the [Sentry error reporting](https://sentry.io) endpoint for the Rails server | | `SENTRY_JAVASCRIPT_DSN` | ` ` | Specifies the [Sentry error reporting](https://sentry.io) endpoint for the frontend used by browsers | | `SENTRY_CURRENT_ENV` | ` ` | Specifies the [Sentry](https://sentry.io) environment used for error reporting | +| `RAILS_LOG_LEVEL` | `info` in production
`debug` in development | Specifies how many log messages to print. The available log levels are: `debug`, `info`, `warn`, `error`, `fatal`, and `unknown`. | | `RAILS_LOG_TO_STDOUT` | `false` in `production` | Enables the server to print log output to the command line | | `RAILS_SERVE_STATIC_FILES` | `true` in `development` and `test`
`false` in `production` and `staging` | Specifies whether the Rails server should be able to handle requests for non-dynamic resources (e.g., assets) | +| `RAILS_TIME_ZONE` | `UTC` | Set the time zone and make Active Record auto-convert to this zone for renderings. Run `rake -D time` for a list of tasks for finding time zone names. | | `BACKTRACE` | `false` | Enables more verbose log output from framework code during debugging | | `TRUSTED_IP` | ` ` in `development` | Enables `BetterErrors` for the given IP addresses during development | | `LISTEN_ADDRESS` | `127.0.0.1` in `development` | Specifies the IP address the Vagrant VM server should attach to during development |