SYSTEM$LOG_DEBUG emits a message at Snowflake’s DEBUG logging level from a stored procedure. DEBUG is the least restrictive level, so it records DEBUG and higher-severity messages when the procedure’s log level permits it. section 4.4
Enable and inspect built-in logging through the account event table:
- Create an event table and associate it with the Snowflake account. section 4.4
- Grant the required account log-level privilege, then set the procedure log level to DEBUG. section 4.4
- Call the procedure and query the event table to retrieve its messages. section 4.4
- Wait several minutes before checking results because account-level logging can be delayed. section 4.4
Log the start of a stored-procedure load
Place SYSTEM$LOG_DEBUG('LOAD_CUSTOMER_ORDERS begin ') in the procedure before the MERGE operation, execute CALL LOAD_CUSTOMER_ORDERS(), and query BAKERY_EVENTS ordered by timestamp descending. section 4.4
Table 4.6 Comparison between custom logging and Snowflake built-in logging
|
Logging type
|
Benefits
|
Drawbacks
|
|---|---|---|
|
Custom
|
Flexibility in what information is needed and when it is logged
|
Must perform custom development
|
|
Snowflake built-in
|
There is no custom development; perform some initial setup, and call the Snowflake built-in logging constructs.
|
Shared across the account; therefore, access controls must be in place to allow developers to access their logging messages
|
Compare Snowflake built-in logging with custom logging, including setup effort, flexibility, and account-wide access-control implications. section 4.4
