Updated on 2023-02-27 GMT+08:00

Managing Logs

KooCLI provides log recording and management to cache the logs generated during API calling. Log files are stored in the following directories:

  • Windows: C:\Users\{Your Windows username}\.hcloud\log\
  • Linux: /home/{Current username}/.hcloud/log/
  • macOS: /Users/{Current username}/.hcloud/log/

Parameters related to log management:

  • level: log level, which can be info, warning, or error.
  • max-file-size: maximum size (MB) of a single log file. Range: 1 to 100. Default value: 20.
  • max-file-num: the number of retained log files. The value 0 indicates that all log files are retained.
  • retention-period: the number of days for retaining log files. The value 0 indicates that log files are retained permanently.

If none of the parameters are specified, the default log level is error, the maximum size of a single log file is 20 MB, and the log retention period is 90 days.

Run the following command to set log-related parameters:

hcloud log set --key1=value1 --key2=value2 ...

hcloud log set --level=error --max-file-size=20 --max-file-num=3 --retention-period=30
Configuration successful.

Run the following command to view log-related parameters:

hcloud log show

hcloud log show
{
  "maxFileSize": 20,
  "maxFileNum": 3,
  "logLevel": "error",
  "logRetentionPeriod": 30
}