lib/rocket_job/extensions/mongo/logging.rb in rocketjob-3.4.3 vs lib/rocket_job/extensions/mongo/logging.rb in rocketjob-3.5.0
- old
+ new
@@ -2,25 +2,29 @@
module Mongo
class Monitoring
class CommandLogSubscriber
include SemanticLogger::Loggable
- self.logger.name = 'Mongo'
+ logger.name = 'Mongo'
def started(event)
@event_command = event.command
end
def succeeded(event)
- logger.debug(message: prefix(event), duration: (event.duration * 1000), payload: @event_command)
+ logger.debug(message: prefix(event),
+ duration: (event.duration * 1000),
+ payload: @event_command)
end
def failed(event)
- logger.debug(message: "#{prefix(event)} Failed: #{event.message}", duration: (event.duration * 1000), payload: @event_command)
+ logger.debug(message: "#{prefix(event)} Failed: #{event.message}",
+ duration: (event.duration * 1000),
+ payload: @event_command)
end
def prefix(event)
- "#{event.address.to_s} | #{event.database_name}.#{event.command_name}"
+ "#{event.address} | #{event.database_name}.#{event.command_name}"
end
end
end
end