snowflake object included with the
Before logging from code, be sure you have the logging level set so that the messages you want are stored in the event table. For more information, refer to Setting Log Level.
Before you can begin logging messages, you must set up an event table. For more information, refer to Setting up an Event Table.
You can access log messages by executing a SELECT command on the event table. For more information, refer to Accessing Logged Message Data.
For general information about setting up logging and retrieving messages in Snowflake, refer to Logging Messages from Functions and Procedures.
Code in the following example uses the included
snowflake object to log messages at each of the supported levels.
Note that a message logged from a method that processes an input row will be logged for every row processed by the UDF. If the UDF is
executed in a large table, this can result in a large number of messages in the event table.
snowflake.log("info", "Information-level message"); snowflake.log("error", "Error message"); snowflake.log("warn", "Warning message"); snowflake.log("debug", "Debug message"); snowflake.log("trace", "Trace message"); snowflake.log("fatal", "Fatal message");