Skip to main content

logs

Creates, updates, deletes, gets or lists a logs resource.

Overview

Namelogs
TypeResource
Idsnowflake.service.logs

Fields

The following fields are returned by SELECT queries:

successful

NameDatatypeDescription
system$get_service_logsstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
fetch_service_logsselectdatabase_name, schema_name, name, instanceId, containerName, endpointnumLinesFetch the logs for a given service.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
containerNamestringContainer name as specified in the service specification file.
database_namestringIdentifier (i.e. name) for the database to which the resource belongs. You can use the /api/v2/databases GET request to get a list of available databases.
endpointstringOrganization and Account Name (default: orgid-acctid)
instanceIdintegerID of the service instance, starting with 0.
namestringIdentifier (i.e. name) for the resource.
schema_namestringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the /api/v2/databases/{database}/schemas GET request to get a list of available schemas for the specified database.
numLinesintegerNumber of trailing log lines to retrieve.

SELECT examples

Fetch the logs for a given service.

SELECT
system$get_service_logs
FROM snowflake.service.logs
WHERE database_name = '{{ database_name }}' -- required
AND schema_name = '{{ schema_name }}' -- required
AND name = '{{ name }}' -- required
AND instanceId = '{{ instanceId }}' -- required
AND containerName = '{{ containerName }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND numLines = '{{ numLines }}';