Configure logging

By default, Snowflake CLI automatically saves INFO, WARNING, and ERROR level messages to log files. To disable or customize logging, create a [cli.logs] section in your config.toml file:

[cli.logs]
save_logs = true
level = "info"
path = "/home/<username>/.snowflake/logs"
Copy

where:

  • save_logs indicates whether to save logs to files. Default: true.

  • level specifies which levels of messages to save to log files. Choose from the following levels, which includes all levels below the selected one:

    • debug

      Warning

      Switching to the debug logging level can expose sensitive information, such as executed SQL queries. Use caution when enabling this level.

    • info

    • warning

    • error

    Default: info

  • path specifies the absolute path to save the log files. The format of the path varies based on your operating system, as shown:

    • Linux: path = "/home/<your_username>/.config/snowflake/logs"

    • MacOS: path = "/Users/<your_username>/Library/Application Support/snowflake/logs"

    • Windows: path = "C:\\Users\\<your_username>\\AppData\\Local\\snowflake\\logs"

    If not specified, the command creates a logs directory in the default config.toml file location.

If your config.toml was created automatically, the config.toml file contains the |cli.logs| section filled with default values.

Logs from a single day are appended to file snowcli.log, which is later renamed to snowcli.log.YYYY-MM-DD, as shown.

ls logs/
Copy
snowcli.log            snowcli.log.2023-12-22