Skip to content

Logging

This guide will go over how the GLIDE clients logger works and how to configure it.

Valkey GLIDE clients are built upon a shared, high-performance Rust Core that utilizes a singleton logger exposed via the Foreign Function Interface (FFI). This architecture allows client wrappers to configure the logger and push their own messages directly into the core, ensuring that all logs remain synchronized and preserve the order of events.

Currently, GLIDE does not support direct integration with third-party logging libraries. While there is interest in adding this capability, it has not yet been prioritized. If this functionality is critical for your use case, we encourage you to submit a feature request to the Valkey GLIDE GitHub.

The logger is currently available for C#, Python, Node, Java, and PHP clients.

The following examples show how to configure the logger in GLIDE clients.

import asyncio
from glide import GlideClientConfiguration, NodeAddress, GlideClient, Logger, LogLevel
async def test_cluster_client():
# Configure the log level and the log file name
Logger.set_logger_config(level = LogLevel.DEBUG, file_name="./glide_logs")
# Logging example
Logger.log(log_level=LogLevel.INFO, log_identifier= "LoggingExample", message = "Hello World!")
# Standalone client configuration
addresses = [NodeAddress("localhost", 6379)]
config = GlideClientConfiguration(addresses)
client = await GlideClient.create(config)
await client.ping()
asyncio.run(test_cluster_client())

Refer to the API reference for the full logger interface.

By default, logs are output to stdout. However, you can configure the logger to write logs to a file by specifying a file name in the configuration methods shown in the examples above.

If the file name is an absolute path /example/logs/client_logs, the logs will be written to the file /example/logs/client_logs.<timestamp>.

If the file name is a relative path ./client_logs, the logs will be written inside the folder glide-logs. For example, ./glide-logs/client_logs.<timestamp>.

To prevent large files, log files are rotated hourly.

Since logs are outputted from the Rust layer, it contains ANSI color code for console outputs. These codes may appear in log files as unknown characters or character codes. To disable these color codes, you can set the environment variable NO_COLOR=1 before starting the logger.

For development and debugging, use DEBUG level to see all internal operations including connection management, topology refreshes, and command routing.

For production, use WARN level with file output. This captures connectivity issues, timeouts, and performance degradation without the overhead of verbose logging.

Refer to the examples above for language-specific configuration.

GLIDE log messages follow this format:

<timestamp> <LEVEL> <component> - <message>

For example:

2026-05-01T19:14:23.081Z WARN logger_core: cluster - disconnected from "172.30.0.11:6379"

Key components you may see in logs:

ComponentDescription
clusterCluster connection management, routing errors, disconnections
pipelineCommand pipeline send/receive, backpressure warnings
connections_logicConnection health checks and reconnection
moved_errorSlot map changes and MOVED/ASK redirect handling
inflightInflight request tracking and limit enforcement
AsyncRegistryJava-side future tracking and timeout delivery
jni_commandJNI layer command dispatch timing