Managing Logs
Cloud CLI 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}\.cloud\log\
- Linux: /home/{Current username}/.cloud/log/
- macOS: /Users/{Current username}/.cloud/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. Default value: 3.
- 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, a single log file is 20 MB, and 3 files are retained.
Run the following command to set log-related parameters:
cloud log set --key1=value1 --key2=value2 ...
cloud log set --level=error --max-file-size=20 --max-file-num=3 --retention-period=30Configuration successful.
Run the following command to view log-related parameters:
cloud log show
cloud log show{"maxFileSize": 20,"maxFileNum": 3,"logLevel": "error","logRetentionPeriod": 30}
Parent topic: Commonly Used Commands