Logging fix for CLI access

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

@ -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:

@ -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)

@ -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)

Loading…
Cancel
Save