Skip to content

Make log output and access log format configurable

João Pereira requested to merge add-new-configs into add-labkit-logging

Related to #31 (closed).

Changes

Access Logs Format

We have to provide a way to log access logs in LabKit's format. Access logs are currently in the Apache combined format, and there is no way to change it. In order to avoid a breaking change, this MR adds a new configuration parameter (log.accesslog.formatter). Possible values are text (for development), json (for production) and combined. combined remains as the default value for backward compatibility.

Log Output

LabKit log output defaults to stderr, but the registry log output is stdout and there is no way to change it. In order to avoid a breaking change, this MR adds a new configuration parameter (log.output). Possible values are stdout and stderr. stdout remains as the default value for backward compatibility.

Tests

The existing configuration test suite is far from ideal. This MRs adds a new set of utility functions which together allow us to easily test individual parameters, all using the standard test library and covering both the YAML configuration file and environment variables.

Note

This MR is going to be merged to a feature branch so that all LabKit logging changes can be merged to master in a single commit.

Edited by João Pereira

Merge request reports

Loading