Skip to content

Configure logging

For the complete documentation index see: llms.txt

All documentation pages available in markdown.

Applies to

  • Aerospike Developer SDK (Java 21+ and Python 3.11+)
  • Aerospike Database 8.2.0 or later, unless a section states otherwise

Client-side logging helps you debug connection issues, monitor cluster health, and troubleshoot performance problems.

Why client logging matters

The Developer SDK runs background threads that:

  • Maintain cluster topology (node discovery)
  • Monitor connection health
  • Handle failover events

These events are logged and crucial for diagnosing production issues.

Enable logging

The Java SDK logs through SLF4J under short category names, not a package name: tend (cluster discovery and node changes), connection, command, query, behavior, info, metrics, ael, and serde. The constants are in com.aerospike.client.sdk.Loggers. Add a logging implementation to your project:

<!-- Logback (recommended) -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.14</version>
</dependency>

Configure logback.xml:

<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!-- Aerospike Java SDK categories -->
<logger name="tend" level="INFO"/>
<logger name="behavior" level="INFO"/>
<root level="WARN">
<appender-ref ref="STDOUT"/>
</root>
</configuration>

Log levels

LevelWhen to UseWhat’s Logged
ERRORProductionConnection failures, unrecoverable errors
WARNProductionRetries, temporary failures, deprecation notices
INFOStagingCluster topology changes, connection events
DEBUGDevelopmentAll operations, request/response details
TRACETroubleshootingWire protocol, internal state

Python’s logging module names the warning level WARNING and has no TRACE level.

<!-- Production -->
<logger name="tend" level="WARN"/>
<logger name="command" level="WARN"/>
<!-- Development -->
<logger name="command" level="DEBUG"/>
<logger name="query" level="DEBUG"/>
<!-- Troubleshooting connection issues -->
<logger name="tend" level="DEBUG"/>
<logger name="connection" level="DEBUG"/>

Disable logging

To completely disable client logging:

<logger name="tend" level="OFF"/>
<logger name="connection" level="OFF"/>
<logger name="command" level="OFF"/>
<!-- Repeat for query, behavior, info, metrics, ael, and serde -->

Or programmatically:

import org.slf4j.LoggerFactory;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import com.aerospike.client.sdk.Loggers;
import java.util.List;
for (String name : List.of(Loggers.AEL, Loggers.BEHAVIOR, Loggers.CONNECTION, Loggers.COMMAND,
Loggers.INFO, Loggers.METRICS, Loggers.QUERY, Loggers.SERDE, Loggers.TEND)) {
((Logger) LoggerFactory.getLogger(name)).setLevel(Level.OFF);
}

📖 API reference: com.aerospike.client.sdk

Custom logger implementation

For advanced scenarios, you can provide a custom logger:

// The client uses SLF4J, so any SLF4J-compatible logger works
// No custom implementation needed - just configure your logging framework

📖 API reference: com.aerospike.client.sdk

Log message reference

Cluster events

The Java SDK logs cluster events on its com.aerospike.client.sdk.tend logger, and the Python SDK on aerospike_core.cluster.

EventJava SDKPython SDK
Seeding startsAdd seed <host> <port> (DEBUG)Seeding the cluster. Seeds count: <n> (INFO)
A seed host failsSeed <host> <port> failed: <error> (WARN). By default, a connect() that reaches no seed throws instead.Failed to validate seed host: <host>:<port> (ERROR)
A node joinsAdd node <name> <host> <port> (INFO)No message per node. Nodes [...] (DEBUG) lists the cluster’s nodes after each tend.
A node leavesRemove node <name> <host> <port> (INFO)Closing node <name>: <host>:<port> (DEBUG)
A node refresh failsNode <name> <host> <port> refresh failed: <error> (WARN)Node `<name>: <host>:<port>` refresh failed: <error> (WARN)

Error messages

Message PatternLikely CauseAction
Failed to connect to [<n>] host(s), result code -8No seed host answered: the server isn’t running, or the address, port, DNS or a firewall keeps the client from reaching it. Each host’s entry gives the reason, such as Connection refused (Python SDK) or Connection failed (Java SDK).Check the server status, and that the client can reach each seed host on its service port
Result code 9 (TIMEOUT): Client timeout or Server timeout (Java SDK), TimeoutError (Python SDK)Network latency or server overloadCheck latency, adjust the Behavior’s timeouts

Next steps

Enable Metrics

Monitor client performance with metrics.

Metrics →