This class is a logger that may be used by the client to log the driver’s actions. It is a subclass of the standard Ruby Logger class, so it is instantiated the same way.

The format of log output is set to include the timestamp, thread-id, log severity, and message. This format may change in newer versions of the driver to account for new/deprecated metadata.

Examples:
Configuring Cluster to use a logger.
cluster = Cassandra.cluster(logger: Cassandra::Logger.new($stderr))
The log format may be changed the same way as in the standard Ruby Logger class
logger = Cassandra::Logger.new($stderr)
logger.formatter = proc { |severity, time, program_name, message|
  "[%s]: %s\n" % [severity, message]
}
Create a logger and use it in your own business logic
logger = Cassandra::Logger.new($stderr)
cluster = Cassandra.cluster(logger: logger)
<various logic>
logger.debug("something interesting happened.")

Inherits

Logger

Methods

self.

new

(*args)

Returns a new instance of Logger