Class Mongo::Monitoring::CommandLogSubscriber
In: lib/mongo/monitoring/command_log_subscriber.rb
Parent: Object

Subscribes to command events and logs them.

@since 2.1.0

Methods

failed   new   started   succeeded  

Included Modules

Loggable

Constants

LOG_STRING_LIMIT = 250   Constant for the max number of characters to print when inspecting a query field.

@since 2.1.0

Attributes

options  [R]  @return [ Hash ] options The options.

Public Class methods

Create the new log subscriber.

@example Create the log subscriber.

  CommandLogSubscriber.new

@param [ Hash ] options The options.

@option options [ Logger ] :logger An optional custom logger.

@since 2.1.0

Public Instance methods

Handle the command failed event.

@example Handle the event.

  subscriber.failed(event)

@param [ CommandFailedEvent ] event The event.

@since 2.1.0

Handle the command started event.

@example Handle the event.

  subscriber.started(event)

@param [ CommandStartedEvent ] event The event.

@since 2.1.0

Handle the command succeeded event.

@example Handle the event.

  subscriber.succeeded(event)

@param [ CommandSucceededEvent ] event The event.

@since 2.1.0

[Validate]