Logging
USP offers configurable logging features that enable administrators to monitor each Component's behavior, diagnose issues, and maintain audit trails. Logs can be directed to standard output or log files, which can be rotated based on size or time policies.
This page explains how to configure logging for each USP Component (USP Manager, USP Server, and USP Client).
Overview
All USP components support configurable logging. Logging is configured in the .hcl configuration file for each component:
usp-manager.hclfor USP Manager.usp-server.hclfor USP Server.usp-client.hclfor USP Client.
While environment variables can override values in the configuration file, we recommend defining all settings in the .hcl file to ensure clear visibility and reproducibility across environments.
Logging Configuration Fields
| HCL Argument Name | Description | Value Type | Default Value |
|---|---|---|---|
log.level | Controls the verbosity of logs. Options (every option contains the messages from the ones below it):
tip Use | string | "INFO" |
log.path | The path to the log file. If no value is set, logs are written to standard output. | string | "" (standard output) |
log.max_size | Rotates logs when the log file grows beyond a threshold measured (in MB). | number | 0 (disabled) |
log.max_backups | Defines how many rotated log files must be kept. Once the number is exceeded, the older log file gets deleted when a new log rotation takes effect. | number | 0 (disabled) |
log.max_age | Rotates logs that are older than a specified number of days. Each Component checks the age of each log file every time a log message is written, and when the configured threshold is reached, it archives the current log as the original log file plus the time at which the log was rotated (name-timestamp.extension). For example: if | number | 0 (disabled) |
Configuration Example With Default Values
log {
level = "info"
path = "/var/log/usp-server.log" # Example with USP Server
max_age = 3
max_size = 100
max_backups = 15
}