SYSTEM$GET_SERVICE_LOGS
functionsupportedContainer services & dev toolingRetrieves local logs from a Snowpark Container Services service container. Snowpark Container Services is available to accounts in AWS, Microsoft Azure, and Google Cloud Platform commercial regions, with some exceptions. For more information, see Available regions and considerations.
Syntax
supportedpartialnot supportednot scored
SYSTEM$GET_SERVICE_LOGS( <service_name>, <instance_id>, <container_name>
[, <number_of_most_recent_lines> ] [, <retrieve_previous_logs> ])
Parameters
| Name | Required | Description |
|---|---|---|
service_name | required | Service name. |
instance_id | required | ID of the service instance, starting with 0. |
container_name | required | Container name as specified in the service specification file. |
number_of_most_recent_lines | optional | Number of trailing log lines to retrieve. Default: Up to 100 KB of the most recent log lines. |
retrieve_previous_logs | optional | If TRUE, the function retrieves logs from a previously terminated container. You can specify this parameter only if the container has been restarted at least once. Default: false (retrieve logs from the currently running container). |
Returns
Returns a string consisting of newline-separated log entries from the specified service container.
Usage notes
- The current role must have the MONITOR privilege on the service to access the container logs.
- The function returns a container log as a string. You can use the SPLIT_TO_TABLE function to convert the string into a table containing one row for each newline-separated entry.