Logging
This page explains how to capture useful logs from your Contrast deployment.
Applicability
Collecting logs is a helpful first step in diagnosing and resolving deployment issues.
Prerequisites
A running Contrast deployment.
How-To
The Contrast CLI, Coordinator, and Initializer can all be configured to emit additional logs.
CLI
The CLI logs can be configured with the --log-level
command-line flag, which
can be set to either debug
, info
, warn
or error
. The default is info
.
Setting this to debug
can get more fine-grained information as to where the
problem lies.
Coordinator and Initializer
The logs from the Coordinator and the Initializer can be configured via the
environment variables CONTRAST_LOG_LEVEL
, CONTRAST_LOG_FORMAT
and
CONTRAST_LOG_SUBSYSTEMS
.
CONTRAST_LOG_LEVEL
can be set to one of eitherdebug
,info
,warn
, orerror
, similar to the CLI (defaults toinfo
).CONTRAST_LOG_FORMAT
can be set totext
orjson
, determining the output format (defaults totext
).CONTRAST_LOG_SUBSYSTEMS
is a comma-separated list of subsystems that should be enabled for logging, which are disabled by default. Subsystems include:kds-getter
,issuer
andvalidator
. To enable all subsystems, use*
as the value for this environment variable. Warnings and error messages from subsystems get printed regardless of whether the subsystem is listed in theCONTRAST_LOG_SUBSYSTEMS
environment variable.
To configure debug logging with all subsystems for your Coordinator, add the following variables to your container definition.
spec: # v1.PodSpec
containers:
image: "ghcr.io/edgelesssys/contrast/coordinator:latest"
name: coordinator
env:
- name: CONTRAST_LOG_LEVEL
value: debug
- name: CONTRAST_LOG_SUBSYSTEMS
value: "*"
# ...
To access the logs generated by the Coordinator, you can use kubectl
with the
following command:
kubectl logs ${COORDINATOR_POD}