[Yandex Cloud documentation](../../index.md) > [Yandex Cloud Functions](../index.md) > [Concepts](index.md) > Function logs

# Function logs

A function writes logs to Yandex Cloud Logging, to the [default log group](../../logging/concepts/log-group.md) for the folder where the function is located.

There are two types of logs:
* Automatic: Logs of requests to functions.
* Custom: Logs that custom code writes to the standard output (`stdout`) and standard error output (`stderr`). The minimum logging level of custom logs is `UNSPECIFIED`.

To learn more about working with logs, see [this Yandex Cloud Logging article](../../logging/index.md).

## Structured logs {#structured-logs}

Apart from text, you can write structured logs in the following JSON format to the standard output (`stdout`) and standard error output (`stderr`):

* `message/msg`: Entry text.
* `level`: Logging level. The available levels are `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, and `FATAL`.
* `stream_name`: Log stream name. It must be from 1 to 63 characters long.

All other JSON fields are automatically written to `json-payload`.

A log must be single-line. Any entry that contains the `message/msg` field and is up to 64 KB is considered a structured log. If a log entry is too large, it is split into multiple entries and treated as text.

You can disable structured logs by setting `STRUCTURED_LOGGING = false`. In this case, any JSON log will be considered plain text.

Structured logging can be used for [concurrent function instance calls](function.md#concurrency) to log the IDs of all calls processed by the function, not just the most recent one. To do this, specify a unique call ID in the `request_id` field. You can get it from the function call context; the way to do this is [runtime](runtime/index.md)-specific. 

## Useful links {#see-also}

* [Writing data to the execution log. Function examples.](../operations/function/logs-write.md)
* [Builder. Logging.](builder.md)