Logging fix for CLI access

pull/544/head
Mikhael Rakauskas 4 months ago
parent a0bb1638eb
commit 64909ea37e

@ -1,10 +1,14 @@
default: &default default: &default
adapter: postgresql adapter: postgresql
encoding: unicode 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: development:
adapter: postgresql
encoding: unicode
database: docuseal_development database: docuseal_development
pool: 5 pool: 5
username: postgres username: postgres
@ -12,8 +16,6 @@ development:
host: localhost host: localhost
test: test:
adapter: postgresql
encoding: unicode
database: docuseal_test database: docuseal_test
pool: 5 pool: 5
username: postgres username: postgres
@ -22,23 +24,11 @@ test:
production: production:
<<: *default <<: *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'] %> sslmode: <%= ENV['DB_SSLMODE'] %>
sslrootcert: <%= ENV['DB_SSLCERT'] %> sslrootcert: <%= ENV['DB_SSLCERT'] %>
staging: staging:
<<: *default <<: *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'] %> sslmode: <%= ENV['DB_SSLMODE'] %>
sslrootcert: <%= ENV['DB_SSLCERT'] %> sslrootcert: <%= ENV['DB_SSLCERT'] %>
variables: variables:

@ -96,13 +96,17 @@ Rails.application.configure do
# Use default logging formatter so that PID and timestamp are not suppressed. # Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = Logger::Formatter.new config.log_formatter = Logger::Formatter.new
# Use a different logger for distributed setups. # logger = ActiveSupport::Logger.new($stdout)
# require "syslog/logger" # logger.formatter = config.log_formatter
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") # config.logger = ActiveSupport::TaggedLogging.new(logger)
logger = ActiveSupport::Logger.new($stdout) config.logger = ActiveSupport::TaggedLogging.new(
logger.formatter = config.log_formatter Logger.new($stdout)
config.logger = ActiveSupport::TaggedLogging.new(logger) )
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) encryption_secret = ENV['ENCRYPTION_SECRET'].presence || Digest::SHA256.hexdigest(ENV['SECRET_KEY_BASE'].to_s)

@ -91,32 +91,13 @@ Rails.application.configure do
# Use default logging formatter so that PID and timestamp are not suppressed. # Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = Logger::Formatter.new config.log_formatter = Logger::Formatter.new
# Use a different logger for distributed setups. config.logger = ActiveSupport::TaggedLogging.new(
# require "syslog/logger" Logger.new($stdout)
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") )
# logger = ActiveSupport::Logger.new($stdout) config.active_job.logger = ActiveSupport::TaggedLogging.new(
# logger.formatter = config.log_formatter Logger.new($stdout)
# 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
encryption_secret = ENV['ENCRYPTION_SECRET'].presence || Digest::SHA256.hexdigest(ENV['SECRET_KEY_BASE'].to_s) encryption_secret = ENV['ENCRYPTION_SECRET'].presence || Digest::SHA256.hexdigest(ENV['SECRET_KEY_BASE'].to_s)

Loading…
Cancel
Save