How to Configure Logging for the Java Thin Client
Configure logging for the GridGain 9 Java thin client using java.util.logging, Logback, or Log4j2.
Prerequisites
Java 11 or later
A GridGain 9 thin client dependency in your Maven or Gradle project
A running cluster for verification (How to Start a Cluster With Docker Compose)
Framework-specific (pick one):
java.util.logging: No additional dependencies (included in the JDK)
Logback:
slf4j-api2.0+ andlogback-classic1.5+Log4j2:
log4j-api,log4j-core, andlog4j-jpl2.24+
<dependency>
<groupId>org.gridgain</groupId>
<artifactId>ignite-client</artifactId>
<!-- Use the latest GridGain 9 version -->
<version>LATEST_GRIDGAIN_9_VERSION</version>
</dependency>GridGain 9 artifacts are hosted on the GridGain Nexus repository, not Maven Central. Add this to your pom.xml:
<repositories>
<repository>
<id>gridgain-external</id>
<url>https://www.gridgainsystems.com/nexus/content/repositories/external</url>
</repository>
</repositories>The group ID is org.gridgain, but the artifact name keeps the ignite- prefix. All Java packages remain org.apache.ignite.*.
Overview
Configure diagnostic logging for the GridGain 9 Java thin client using java.util.logging (JUL), Logback with SLF4J, or Log4j2. The thin client uses System.Logger (Java 9+) and routes to JUL by default. Three framework sections follow: pick the one that matches your project and skip the others.
JUL uses different level names than Logback and Log4j2. The level mapping table below applies to all three configurations.
Level Name Mapping
JUL rejects level names like DEBUG or TRACE with IllegalArgumentException: Bad level "DEBUG". Use the correct names for your framework:
Most verbose
TRACE
FINER
TRACE
Diagnostic
DEBUG
FINE
DEBUG
Informational
INFO
INFO
INFO
Potential issues
WARNING
WARNING
WARN
Failures
ERROR
SEVERE
ERROR
Configure java.util.logging
JUL is the default backend with no additional dependencies.
Properties File Approach
Create a file named logging.properties:
org.apache.ignite.internal.client.level = FINE sets the client package to diagnostic output. The ConsoleHandler.level must also be FINE or the handler filters out the messages before they reach the console.
Load the properties file at JVM startup:
Programmatic Approach
Configure JUL in code if JVM startup parameters are not modifiable:
Call configureLogging() before creating the IgniteClient.
Verify JUL Output
Connect to the cluster. Connection events appear at FINE level on standard error:
Configure Logback With SLF4J
Logback requires an adapter to bridge System.Logger to SLF4J. Add the dependencies, create the adapter and factory classes, and pass the factory to the client builder.
Add Logback Dependencies
Create the System.Logger Adapter
Create the adapter that implements System.Logger and delegates to SLF4J:
isLoggable() delegates level checks to the SLF4J logger. The two log() overloads handle throwables and format parameters respectively. MessageFormat.format() applies {0}, {1} substitution before passing the message to SLF4J.
Create the LoggerFactory
Pass the Factory to the Client Builder
Configure logback.xml
additivity="false" on the GridGain logger prevents messages from propagating to the root logger. Without it, each client message appears twice.
Verify Logback Output
Connect to the cluster. Connection events appear at DEBUG level:
The abbreviated logger name o.a.i.i.client.TcpClientChannel corresponds to org.apache.ignite.internal.client.TcpClientChannel. The %logger{36} pattern shortens package segments to fit within 36 characters.
Configure Log4j2
The log4j-jpl module bridges System.Logger to Log4j2 automatically via ServiceLoader. No custom adapter or factory class is needed.
Add Log4j2 Dependencies
log4j-jpl registers a System.LoggerFinder via META-INF/services. The JVM discovers it on the first call to System.getLogger() and routes all System.Logger output to Log4j2.
Build the Client
The standard builder uses System.Logger internally, and log4j-jpl intercepts it:
Configure log4j2.xml
The status="WARN" attribute on <Configuration> controls Log4j2's own internal logging. The GridGain client logger is set to DEBUG with additivity="false" to prevent duplicate output through the root logger.
Verify Log4j2 Output
Connect to the cluster. Connection events appear at DEBUG level:
The full class name org.apache.ignite.internal.client.TcpClientChannel appears because the name fits within the %logger{36} width limit. The output format matches the PatternLayout in log4j2.xml.
Log Categories
The client creates loggers from fully qualified class names. Use these names in your logging configuration to control verbosity per component:
org.apache.ignite.internal.client.TcpClientChannel
Connection establishment, heartbeats, request/response cycles
org.apache.ignite.internal.client.ReliableChannel
Failover decisions, retry attempts, channel selection
org.apache.ignite.internal.client.sql.ClientSql
SQL query execution, partition awareness routing
org.apache.ignite.internal.client.table.ClientTable
Table operations, schema version management
org.apache.ignite.internal.streamer.StreamerSubscriber
Bulk data streaming, batch processing (this category is outside the org.apache.ignite.internal.client parent)
org.apache.ignite.internal.client.ClientTimeoutWorker
Operation timeout detection and handling
The parent category org.apache.ignite.internal.client controls the client logging categories that start with that prefix with a single entry. Data streamer logging is configured separately, through the streamer category above. Use the specific categories above to enable verbose logging for one component without increasing output from the others.
Production Recommendations
Set the client logger to WARN (WARNING in JUL) in production. Connection failures, heartbeat timeouts, and handshake errors appear at WARN level; per-request output does not.
Logback:
Log4j2:
java.util.logging:
Enable DEBUG (FINE in JUL) temporarily to troubleshoot connection or failover issues. TRACE (FINER in JUL) logs every outbound request with operation code and destination address; use it only for short diagnostic sessions.
Troubleshooting
Related
How to Start a Cluster with Docker Compose - Set up the 3-node development cluster used to verify logging output.
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

