Sha256: 94e327f49f41e3eafb152de55b1cb703b61a483e8f51913454e8cb19769123f0
Contents?: true
Size: 784 Bytes
Versions: 17
Compression:
Stored size: 784 Bytes
Contents
require 'mongo/monitoring/command_log_subscriber' module Mongo class Monitoring class CommandLogSubscriber include SemanticLogger::Loggable 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) end def failed(event) logger.debug(message: "#{prefix(event)} Failed: #{event.message}", duration: (event.duration * 1000), payload: @event_command) end def prefix(event) "#{event.address} | #{event.database_name}.#{event.command_name}" end end end end
Version data entries
17 entries across 17 versions & 1 rubygems