Viewing container logs
Container runtime logs are stored for 14 days. The log uses UTC time.
- In the management console, select Serverless Containers.
- Click on a container to view its runtime log.
- Go to the Logs tab and specify the period for which you wish to view logs. The default time period is 1 hour.
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.
When viewing the log, you can set a specific interval using the --since
and --until
flags. If no time interval is specified, information for the previous 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
.
To access a container, use its name or unique ID. To get them, get a list of containers in the folder.
View the container runtime log:
yc logging read --resource-ids=<container_ID>
Result:
2021-12-07 10:39:03 INFO START RequestID: 24ad08bd-10f7-4e76-9f08-b2b14b04495b
2021-12-07 10:39:03 Hi, I'm inside
2021-12-07 10:39:03 runtime pid 76: exited with 0
...
2021-12-07 10:42:04 INFO END RequestID: 24ad08bd-10f7-4e76-9f08-b2b14b04495b
Learn more about working with logs in the Yandex Cloud Logging documentation.