SYSTEM$GET_APPLICATION_SERVICE_LOGS
functionpartialNative apps, listings & sharingReturns the container logs for a running Application Service. Use this function to troubleshoot a deployed application.
Syntax
supportedpartialnot supportednot scored
SYSTEM$GET_APPLICATION_SERVICE_LOGS( '<service_identifier>' [ , <tail_lines> [ , <instance_id> ] ] )
Parameters
| Name | Required | Description |
|---|---|---|
service_identifier | required | Fully qualified or unqualified identifier of the Application Service. |
tail_lines | required | Optional number of log lines to return, starting from the end. The default is 500. |
instance_id | required | Optional instance number to get logs from. Instances are numbered from 0. The default is 0. If that instance isn’t running, Snowflake returns an error that lists the valid IDs, for example: Invalid instance id 3. Valid instance ids: 0, 1. |
Returns
A string that contains the concatenated log output from the service containers.
Usage notes
- The service identifier must be enclosed in single quotes.
- The service must be in a running state to return container logs. For a suspended service, the function returns an empty result.
- If the service has more than one instance, pass instance_id to choose which one. You must also pass tail_lines.
- For structured logs routed through an active event table, query the event table directly. For more information, see Logging, tracing, and metrics.
Access control requirements
The role must have the MONITOR privilege on the Application Service.
Known gaps
- <tail_lines> / <instance_id> are not exercised by any test