Logging

Multiplatform-based, the issuer API logging service enables dynamic reconfigurations, multiple log outputs, and integrations with log aggregator systems supporting various log output formats. Next to that, structured logging instead of plain messages and context login (similar to MDC) are supported.

Multiplatform Logging

Our logging implementation utilizes multiplatform libraries that are aligned with the logging systems already in use across different platforms. Below are the specific logging systems targeted:

  • Android: android.util.Log
  • macOS/iOS: Darwin log system
  • Java/JVM: SLF4J
  • JavaScript: Console logger

This ensures that the logging system remains consistent with the platform's native logging practices.

Capability Overview

The logging service is provided by the service commons module in the identity lib, enabling the following capabilities.

Dynamic Reconfigurations

  • Multiple Log Outputs: Logs can be sent to multiple destinations simultaneously.
  • Log Aggregators: Logs can be pushed to various log aggregators including standard output/error, Seq, Graylog, and Logstash (part of the ELK stack).

Log Output Formats

The multi log output formats enable integrations with different tools and platforms. Supported formats include:

  • CLEF: Compact JSON format.
  • Elastic Common Schema: Standard format for logging data.
  • Elastic Common Schema for .NET: Specialized format for .NET applications.
  • GELF: JSON format optimized for Graylog.
  • JSON: Format for Splunk HTTP Event Collector.
  • Simple & ISO 8601 Rendering: Easy-to-read and ISO 8601 standard timestamp formats.

Configuration & Setup

Configuring the logging system can be done in two main ways:

  1. Predefined Setups: Select from simplified pre-defined logging setups curated by walt.id by setting a command line argument. If no configuration is detected, a default logging setup is used to ensure logging is active and functional out-of-the-box.
  2. Configuration File: For maximum flexibility configuration is possible via a file in HOCON or JSON format.

Predefined Setup

To use the predefined setups provide one of the following arguments on service startup or setup an environment variable with the same name in the service environment.

--log-level=default
--log-level=debug
--log-level=trace

Switch logging type (different rendering):
--log-type=simple (no colors)
--log-type=ansi (colors ) (default)
--log-type=iso8601 (iso timestamp)
--log-type=clef (Compact Log Event Format)
--log-type=gelf (Graylog Extended Log Format)
--log-type=ecs (Elastic Common Schema)
--log-type=ecs_dotnet (Elastic Common Schema for .net)

Configuration File

Setup a JSON (.json) or HOCON (.conf) config file, in this format: some options are explained here