Skip to content

Commit

Permalink
chore: update db logging config
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Jun 25, 2020
1 parent d4349ca commit 2f685b1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 32 deletions.
4 changes: 2 additions & 2 deletions pact_broker/database_connection.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'sequel'
require_relative 'database_logger'
require 'pact_broker/db/log_quietener'

def create_database_connection_from_config(logger, config)
##
Expand All @@ -20,7 +20,7 @@ def create_database_connection_from_config(logger, config)
# when databases are restarted and connections are killed. This has a performance
# penalty, so consider increasing this timeout if building a frequently accessed service.
logger.info "Connecting to database with config: #{config.merge(password: "*****")}"
connection = Sequel.connect(config.merge(logger: DatabaseLogger.new(logger)))
connection = Sequel.connect(config.merge(logger: PactBroker::DB::LogQuietener.new(logger)))
connection.extension(:connection_validator)
connection.pool.connection_validation_timeout = -1
connection
Expand Down
29 changes: 0 additions & 29 deletions pact_broker/database_logger.rb

This file was deleted.

2 changes: 1 addition & 1 deletion pact_broker/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

SemanticLogger.add_appender(io: $stdout)
SemanticLogger.default_level = log_level
$logger = SemanticLogger['root']
$logger = SemanticLogger['pact-broker']

PADRINO_LOGGER = {
ENV.fetch('RACK_ENV').to_sym => { log_level: :error, stream: :stdout, format_datetime: '%Y-%m-%dT%H:%M:%S.000%:z' }
Expand Down

0 comments on commit 2f685b1

Please sign in to comment.