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_LEVELcan be set to one of eitherdebug,info,warn, orerror, similar to the CLI (defaults toinfo).CONTRAST_LOG_FORMATcan be set totextorjson, determining the output format (defaults totext).CONTRAST_LOG_SUBSYSTEMSis a comma-separated list of subsystems that should be enabled for logging, which are disabled by default. Subsystems include:kds-getter,issuerandvalidator. 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_SUBSYSTEMSenvironment 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:v1.13.0@sha256:65e7832acb46d952d5c96c824d6f370999b8f3d547b3c2c449e82d8dc4b4816c"
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}
