Sha256: 75b26a35dc9e1931a4d0f9b115db64b3d5fe3ce0123ca9860bcaa41e68c249ef
Contents?: true
Size: 784 Bytes
Versions: 20
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
20 entries across 20 versions & 1 rubygems