diff --git a/config/database.yml b/config/database.yml index 0c804623..35795896 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,10 +1,14 @@ default: &default adapter: postgresql encoding: unicode + host: <%= ENV['DB_HOST'] %> + port: <%= ENV['DB_PORT'] %> + pool: <%= ENV['DB_POOL'] || 25 %> + username: <%= ENV['DB_USERNAME'] %> + password: <%= ENV['DB_PASSWORD'] %> + database: <%= ENV['DB_NAME'] %> development: - adapter: postgresql - encoding: unicode database: docuseal_development pool: 5 username: postgres @@ -12,8 +16,6 @@ development: host: localhost test: - adapter: postgresql - encoding: unicode database: docuseal_test pool: 5 username: postgres @@ -22,23 +24,11 @@ test: production: <<: *default - host: <%= ENV['DB_HOST'] %> - port: <%= ENV['DB_PORT'] %> - pool: <%= ENV['DB_POOL'] || 25 %> - username: <%= ENV['DB_USERNAME'] %> - password: <%= ENV['DB_PASSWORD'] %> - database: <%= ENV['DB_NAME'] %> sslmode: <%= ENV['DB_SSLMODE'] %> sslrootcert: <%= ENV['DB_SSLCERT'] %> staging: <<: *default - host: <%= ENV['DB_HOST'] %> - port: <%= ENV['DB_PORT'] %> - pool: <%= ENV['DB_POOL'] || 25 %> - username: <%= ENV['DB_USERNAME'] %> - password: <%= ENV['DB_PASSWORD'] %> - database: <%= ENV['DB_NAME'] %> sslmode: <%= ENV['DB_SSLMODE'] %> sslrootcert: <%= ENV['DB_SSLCERT'] %> variables: diff --git a/config/environments/production.rb b/config/environments/production.rb index 7e422baa..c745690e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -96,13 +96,17 @@ Rails.application.configure do # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = Logger::Formatter.new - # Use a different logger for distributed setups. - # require "syslog/logger" - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") + # logger = ActiveSupport::Logger.new($stdout) + # logger.formatter = config.log_formatter + # config.logger = ActiveSupport::TaggedLogging.new(logger) - logger = ActiveSupport::Logger.new($stdout) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) + config.logger = ActiveSupport::TaggedLogging.new( + Logger.new($stdout) + ) + + config.active_job.logger = ActiveSupport::TaggedLogging.new( + Logger.new($stdout) + ) encryption_secret = ENV['ENCRYPTION_SECRET'].presence || Digest::SHA256.hexdigest(ENV['SECRET_KEY_BASE'].to_s) diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 286a868a..89b8940c 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -91,32 +91,13 @@ Rails.application.configure do # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = Logger::Formatter.new - # Use a different logger for distributed setups. - # require "syslog/logger" - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") - - # logger = ActiveSupport::Logger.new($stdout) - # logger.formatter = config.log_formatter - # config.logger = ActiveSupport::TaggedLogging.new(logger) - - # NEWRELIC_MONITOR_MODE enables stdout logger sync for worker/web via NR APM - if ENV['NEWRELIC_MONITOR_MODE'].presence - config.logger = ActiveSupport::TaggedLogging.new( - Logger.new($stdout) - ) - - config.active_job.logger = ActiveSupport::TaggedLogging.new( - Logger.new($stdout) - ) - else - config.logger = ActiveSupport::TaggedLogging.new( - Syslog::Logger.new('rails-main') - ) - - config.active_job.logger = ActiveSupport::TaggedLogging.new( - Syslog::Logger.new('rails-sidekiq') - ) - end + config.logger = ActiveSupport::TaggedLogging.new( + Logger.new($stdout) + ) + + config.active_job.logger = ActiveSupport::TaggedLogging.new( + Logger.new($stdout) + ) encryption_secret = ENV['ENCRYPTION_SECRET'].presence || Digest::SHA256.hexdigest(ENV['SECRET_KEY_BASE'].to_s)