Viewing the execution log
Function execution logs are stored for 14 days. The log uses Coordinated Universal Time, UTC.
- Select Cloud Functions in management console.
- Click the function you want to view the execution log for.
- In the window that opens, go to Logs and specify the time period. The default time period is 1 hour.
When viewing the log, you can set a specific interval using the --since
and --until
flags. If no interval is specified when invoking a function, information for the last hour is displayed.
The following flags are used:
-
--since
: Time N and later. -
--until
: Time N and earlier.
If you only specify one flag, information is displayed for the hour before or after N depending on the flag.
Allowed time formats:
-
HH:MM:SS
. Example:15:04:05
. -
RFC-3339. Example:
2006-01-02T15:04:05Z
,2h
,3h30m ago
.
If you don't have the Yandex.Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To access a function, use its name or unique ID. To find them, get a list of functions in a folder.
View the function execution log:
$ yc serverless function logs <function name>
Result:
2019-07-04 09:27:43 START RequestID: 34dc9533-ed6e-4468-b9f2-2aa082266fad Version: b09i2s85a0c1fisjboft
2019-07-04 09:27:43 END RequestID: 34dc9533-ed6e-4468-b9f2-2aa082266fad
2019-07-04 09:27:43 REPORT RequestID: 34dc9533-ed6e-4468-b9f2-2aa082266fad Duration: 538.610 ms Billed Duration: 538.700 ms Memory Size: 128 MB Max Memory Used: 13 MB
2019-07-04 09:29:25 START RequestID: 5b6a3779-dcc8-44ec-8ee2-2e7f279394ef Version: b09i2s85a0c1fisjboft
2019-07-04 09:29:26 END RequestID: 5b6a3779-dcc8-44ec-8ee2-2e7f279394ef
2019-07-04 09:29:26 REPORT RequestID: 5b6a3779-dcc8-44ec-8ee2-2e7f279394ef Duration: 554.904 ms Billed Duration: 555.000 ms Memory Size: 128 MB Max Memory Used: 13 MB
...
Note
If you called a function with a specific tag, you must also specify this tag when viewing the execution log: yc serverless function logs my-python-function --tag test
.