lib/semantic_logger/appender/mongodb.rb in semantic_logger-4.1.1 vs lib/semantic_logger/appender/mongodb.rb in semantic_logger-4.2.0
- old
+ new
@@ -104,11 +104,11 @@
# Name of this application to appear in log messages.
# Default: SemanticLogger.application
def initialize(uri:, collection_name: 'semantic_logger', write_concern: 0, collection_size: 1024**3, collection_max: nil,
level: nil, formatter: nil, filter: nil, host: nil, application: nil, &block)
- @client = Mongo::Client.new(uri, logger: SemanticLogger::Processor.logger.clone)
+ @client = Mongo::Client.new(uri, logger: logger)
@collection_name = collection_name
@options = {
capped: true,
size: collection_size,
write: {w: write_concern}
@@ -159,11 +159,9 @@
create_indexes
end
# Log the message to MongoDB
def log(log)
- return false unless should_log?(log)
-
# Insert log entry into Mongo
collection.insert_one(formatter.call(log, self))
true
end