Skip to content
Webinar - July 10: Cut Infra Costs by 80% with Smarter DRAM, NVMe & Cloud Storage StrategyRegister now

Logging

The Aerospike Rust client uses the light-weight logging 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 implementations 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