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:
1export SF_LOG_LEVEL=debugRotating 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. Backups are kept for the past two days along with the current day’s logs. This behavior ensures that the current log file doesn't get too large.
You can change the default behavior with these environment variables:
- SF_LOG_ROTATION_PERIOD: How often a new log file is created, such as the default value of one day (1d) or two weeks 2w.
- SF_LOG_ROTATION_COUNT: Number of backup files to keep. Default value is 2.
For example, let's say you choose a rotation period of 2 weeks and a count of 2. These values ensure that you have backup logs for the four weeks before the first entry in the current log.