Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.
Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.
Use the following information to troubleshoot issues with the Databricks CLI.
Enable logging
If a command fails or does not produce the expected output, you can use logging to help identify what might have gone wrong. You can log messages that the Databricks CLI outputs about various command events, warnings, and errors. To log these messages, specify the following Databricks CLI command options:
| Flag | Description |
|---|---|
--log-file |
A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr. |
--log-format |
text to write output logs to text or json to write output logs to JSON. If this flag is not specified then output logs are written as text. |
--log-level |
A string representing the log format level. If not specified then the log format level is disabled. |
For --log-level, specify one of the following levels:
errorto log messages at theerrorlevel only.warnto log messages at thewarnanderrorlevels.infoto log messages at theinfo,error, andwarnlevels.debugto log messages at thedebug,info,error, andwarnlevels. (--debugis equivalent to--log-level debug.)traceto log messages at thetrace,debug,info,error, andwarnlevels.disabledto not log messages. This is the default if--log-levelis not specified.
The following example command logs error messages for only the specified command to a text file named databricks-cli.log. --log-format text is optional because messages are logged in text format by default.
databricks clusters list --log-file databricks-cli.log --log-format text --log-level error
The following example command logs trace, debug, info, error, and warn messages for the specified command to a file named databricks-cli.log in JSON format.
databricks clusters list --log-file databricks-cli.log --log-format json --log-level trace
The following example command logs debug, info, error, and warn messages for the specified command to a file named databricks-cli.log in text format. Because --log-format is not specified, messages are logged in text format.
databricks clusters list --log-file databricks-cli.log --log-level debug
The following example command logs info, error, and warn messages for the specified command to stderr. Because --log-format is not specified, messages are logged in text format.
databricks clusters list --log-level info