The Java Client uses OkHttp for all HTTP communication with MarkLogic. Optional network traffic logging is controlled by two Java system properties:
OKHTTP_NETWORK_LEVEL —
controls the verbosity of logged HTTP traffic.OKHTTP_NETWORK_OUTPUT —
controls where log lines are written.When the output is set to LOGGER, log lines are
written to the SLF4J logger category OKHTTP_NETWORK_LOGGER at
INFO level. Configure this category in your logging
framework to enable network diagnostics without enabling debug
logging for unrelated client internals. For example, in
logback.xml:
<logger name="marklogic.okhttp.network" level="INFO"/>
Or in a Spring Boot application.properties
file:
logging.level.marklogic.okhttp.network=INFO
Security warning: Authorization
and x-auth-token header values are automatically
redacted from all log output. However, HEADERS and
BODY levels may expose other sensitive data including
MarkLogic document content. Never enable HEADERS or
BODY in a production environment.
static final Stringstatic final StringOKHTTP_NETWORK_OUTPUT is
set to LOGGER.static final String"marklogic.okhttp.network.level"
Accepted values (case-insensitive): BASIC,
HEADERS, BODY, NONE. Setting
this property to any recognised value activates the network logging
interceptor.
Security warning: HEADERS and
BODY levels log HTTP request and response headers
and/or bodies, which may contain MarkLogic credentials, OAuth/SAML
tokens, or sensitive document content. These levels must
never be enabled in production environments.
Authorization and x-auth-token header
values are automatically redacted, but body content is not.
"marklogic.okhttp.network.output"
Accepted values (case-insensitive):
LOGGER — writes to the SLF4J logger category
OKHTTP_NETWORK_LOGGER at
INFO level.STDERR — writes to System.err.System.out.OKHTTP_NETWORK_OUTPUT is
set to LOGGER. Value:
"marklogic.okhttp.network"
Configure this category at INFO level in your
logging framework to enable network traffic logging. Example
logback.xml configuration:
<logger name="marklogic.okhttp.network" level="INFO"/>
Example Spring Boot application.properties:
logging.level.marklogic.okhttp.network=INFO
Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.