Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Solutions
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Cloud Functions
  • Getting started
    • Overview
    • Creating a function
      • Overview
      • Python
      • Node.js
      • PHP
      • Go
      • Bash
    • Creating a trigger
      • Overview
      • Timer
      • Trigger for Message Queue
      • Trigger for Object Storage
      • Trigger for Container Registry
      • Trigger for Cloud Logs
      • Trigger for Yandex IoT Core
  • Step-by-step instructions
    • All instructions
    • Using functions to get an IAM token for a service account
    • Managing rights to access functions
    • Managing functions
      • Creating a function
      • Managing function versions
      • Working in the code editor
      • Invoking a function
      • Updating a function
      • View monitoring charts
      • Viewing the execution log
      • Delete function
    • Managing triggers
      • Getting information about a trigger
      • Creating a timer
      • Creating a trigger for Message Queue
      • Creating a trigger for Object Storage
      • Creating a trigger for Container Registry
      • Creating a trigger for Cloud Logs
      • Creating a trigger for Yandex IoT Core
      • Updating a trigger
      • Deleting a trigger
  • Concepts
    • Overview
    • Function
    • Invoking a function
    • Runtime environment
      • Overview
      • Environment
      • Execution context
    • Builder
    • Trigger
      • Overview
      • Timer
      • Trigger for Message Queue
      • Trigger for Object Storage
      • Trigger for Container Registry
      • Trigger for Cloud Logs
      • Trigger for Yandex IoT Core
    • Dead Letter Queue
    • Log groups
    • Monitoring
    • Backups
    • Quotas and limits
  • Developing in Node.js
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Developing in Python
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Developing in Go
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Developing in PHP
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
  • Developing in Bash
    • Overview
    • Request handler
    • Logging
    • Handling errors
    • Using the SDK
  • Developing in Java
    • Overview
    • Programming model
      • Overview
      • Function interface
      • YcFunction interface
      • HttpServlet class
      • Spring Boot
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Developing in R
    • Overview
    • Programming model
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
  • Developing in C#
    • Overview
    • Programming model
      • Overview
      • Function interface
      • YcFunction interface
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Use cases
    • Creating skills for Alice
  • Pricing policy
  • Access management
  • API Functions reference
    • Authentication in the API
    • gRPC
      • Overview
      • FunctionService
      • OperationService
    • REST
      • Overview
      • Function
        • Overview
        • create
        • createVersion
        • delete
        • get
        • getVersion
        • getVersionByTag
        • list
        • listAccessBindings
        • listOperations
        • listRuntimes
        • listTagHistory
        • listVersions
        • removeTag
        • setAccessBindings
        • setTag
        • update
        • updateAccessBindings
  • API Triggers reference
    • Authentication in the API
    • gRPC
      • Overview
      • TriggerService
      • OperationService
    • REST
      • Overview
      • Trigger
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • pause
        • resume
        • update
  • Questions and answers
  1. Developing in Java
  2. Logging

Logging

  • System messages

Cloud Functions automatically captures an application's standard output streams and sends them to the centralized logging system available in Yandex.Cloud. In addition to the application run history, the system logs request execution events.

Additional messages are logged using standard language constructs:

  1. System.out.println: Outputs a message to the standard output stream, stdout.
  2. System.err.println: Outputs a message to the standard error stream, stderr.
  3. Instant.now + Duration.between (and other methods): Returns the action duration.

Note

Multiline messages must be separated by \r (carriage return) and not by \n (line feed). When using a line feed, each line is sent as a separate message and displayed separately in the log.

For more information about string formatting, see the relevant section of the documentation.

System messages

When handling each function call, the system logs START, END, and REPORT system messages:

START RequestID: <request ID> Version: <function version ID>
END RequestID: <request ID>
REPORT RequestID: <request ID>
    Duration: 236.606 ms
    Billed Duration: 300 ms
    Memory Size: 128 MB
    Max Memory Used: 22 MB
    Queuing Duration: 0.027 ms
    Function Init Duration: 225.298 ms

All lines contain the ID of the request (RequestID), which is generated automatically when the function is invoked.

The REPORT line provides a report on the function execution. It contains additional information about the resources consumed:

  • Duration: The time spent invoking the function. It includes the Queuing Duration and Function Init Duration parameters.
  • Billed Duration: The time you're billed for in accordance with the pricing policy.
  • Memory Size: The amount of memory specified when creating the version, MB.
  • Max Memory Used: The amount of memory used at the start of the request.
  • Queuing Duration: The time spent by the function call request in the internal queue. If it increases, this may mean there aren't enough function instances. The maximum number of instances depends on the quotas.
  • Function Init Duration: The time spent initializing the runtime and loading the function code.
Language / Region
Careers
Privacy policy
Terms of use
Brandbook
© 2021 Yandex.Cloud LLC