Skip to content
Webinar - May 13th: How Criteo powers real-time decisions with a reduced footprintRegister now

Logging

The Aerospike Rust client uses the light-weight loggig facade provided by the log crate. Application using the Aerospike client can choose the logging implementation that is most suitable for its use case.

Using the log API with env_logger

The env_logger crate provides an implemenations of the logging facade defined by the log crate. To enable logging using env_logger, add it to your applications dependencies:

[dependencies]
env_logger = "0.3"

Enabling logging for the aerospike module

(Following is a small excerpt of the env_logger documentation; for more information please refer to the full documentation.)

Log levels are controlled on a per-module basis, and by default all logging is disabled except for error!. Logging is controlled via the RUST_LOG environment variable. The value of this environment variable is a comma-separated list of logging directives. A logging directive is of the form:

path::to::module=log_level

To turn on all logging for the Aerospike client you would use a value of

RUST_LOG=aerospike

The actual log_level is optional to specify. If omitted, all logging will be enabled. If specified, it must be one of the strings debug, error, info, warn, or trace.

Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?