Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
Yandex Serverless Containers
  • Comparison with other Yandex Cloud services
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Getting an IAM token for a service account using a container
    • Getting information about a container
    • Managing rights to access a container
    • Creating a container
    • Invoking a container
    • Managing a container
      • Updating a container
      • Scaling a container
      • Adding environment variables
      • Specifying a cloud network
      • Transmitting Yandex Lockbox secrets
      • Managing labels
      • Viewing monitoring charts
      • Viewing logs
      • Deleting a container
    • Getting information about a trigger
    • Creating a trigger
    • Managing triggers
  • Concepts
  • Practical guidelines
  • Access management
  • Pricing policy
  • Containers API reference
  • API Triggers reference
  • Questions and answers
  1. Step-by-step instructions
  2. Managing a container
  3. Viewing logs

Viewing container logs

Written by
Yandex Cloud

    Container runtime logs are stored for 14 days. The log uses UTC time.

    Management console
    CLI
    1. In the management console, select Serverless Containers.
    2. Click on a container to view its runtime log.
    3. 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.

    Was the article helpful?

    Language / Region
    Yandex project
    © 2023 Yandex.Cloud LLC