Newer Version Available
Log Messages and Log Levels
The default level of log messages is warn. You can set the log level to one of the following, listed in order of least to most information. The level is cumulative: for the debug level, the log file also includes messages at the info, warn, and error levels.
- error
- warn
- info
- debug
- trace
- fatal
Globally set the log level for all CLI commands with the SF_LOG_LEVEL environment variable. For example, on UNIX:
Rotating Log Files
Salesforce CLI uses rotating log files. By default, every day at midnight Salesforce CLI makes a backup copy of the log file and then clears out its entries to start afresh. This behavior ensures that the current log file doesn't get too large.
Salesforce CLI checks for, and then deletes, any log files that are older than seven days. If you want to keep these old log files, copy them to a different location.
You can change how often a new log file is created by setting the SF_LOG_ROTATION_PERIOD environment variable to either 1h (one hour) or 1m (one minute). Both of these values result in more, but smaller, log files. Any other value is treated as 1d, which is the default value.