[Yandex Cloud documentation](../../../../index.md) > [Yandex Serverless Integrations](../../../index.md) > [Step-by-step guides](../../index.md) > EventRouter > Managing a bus > Writing logs

# Writing to the bus execution log

{% note info %}

Logging is not free of charge. For more information, see [Yandex Cloud Logging pricing](../../../../logging/pricing.md).

{% endnote %}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), go to the [folder](../../../../resource-manager/concepts/resources-hierarchy.md#folder) containing the [bus](../../../concepts/eventrouter/bus.md).
  1. Navigate to **Serverless Integrations**.
  1. In the left-hand panel, select ![image](../../../../_assets/console-icons/object-align-center-vertical.svg) **EventRouter**.
  1. Click ![image](../../../../_assets/console-icons/ellipsis.svg) in the bus row and select ![image](../../../../_assets/console-icons/pencil.svg) **Edit**.
  1. Under **Logging**:

      1. Enable **Write logs**.
      1. In the **Destination** field, select:

         * `Folder`: To write logs to the default log group for the folder containing the bus.
         * `Log group`: To write logs to a custom log group.
           
           Select the log group to write logs to or [create](../../../../logging/operations/create-group.md) a new one.

      1. Optionally, select the minimum logging level.

  1. Click **Save**.

  If you set the minimum logging level, logs of that level and higher will be written to the execution log. With no minimum logging level set, all bus logs will be written to the execution log.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  ## Enabling logging {#enabled}
  
  To write logs when [creating](create.md) or [updating](update.md) a [bus](../../../concepts/eventrouter/bus.md), specify the `--enable-logging` parameter.
  
  ## Logging destination {#destination}
  
  For logging to the [folder](../../../../resource-manager/concepts/resources-hierarchy.md#folder)'s default [log group](../../../../logging/concepts/log-group.md), provide that folder's ID in the `folder-id` subparameter under `--log-options`. If the bus resides in another folder, the [account](../../../../iam/concepts/users/accounts.md) used to run the command must have the `logging.editor` [role](../../../../logging/security/index.md#logging-editor) or higher for that folder.
  
  For logging to a custom log group, provide that log group's ID in the `log-group-id` subparameter under `--log-options`. The log group may reside in a different folder. The account used to run the command must have the `logging.editor` role or higher for that folder.

  ## Minimum logging level {#log-level}

  To set the minimum logging level, specify it in the `min-level` parameter when creating or updating a bus.

  If you set the minimum logging level, logs of that level and higher will be written to the execution log. With no minimum logging level set, all bus logs will be written to the execution log.

  ## Disabling logging {#disabled}

  To disable logging, specify the `--disable-logging` parameter when updating the bus.

  ## Command example {#example}

  To write logs to a custom log group, run this command:

  ```
  yc serverless eventrouter bus update <bus_name_or_ID> \
    --enable-logging \
    --log-options log-group-id=<log_group_ID>,min-level=<minimum_logging_level>
  ```

  Where:

  * `--log-options`: Logging parameters:
    * `log-group-id`: Log group ID.
    * `min-level`: Minimum logging level. This is an optional setting.

  Result:

  ```text
  id: f66302237ren********
  folder_id: b1g0ijbfaqsn********
  cloud_id: b1gia87mbaom********
  created_at: "2025-07-13T16:47:31.559209Z"
  name: my-bus
  status: ACTIVE
  logging_enabled: true
  log_options:
    log_group_id: e23uimb4tabs********
    min_level: DEBUG
  ```

- API {#api}

  For logging to the bus execution log, use the [Update](../../../eventrouter/api-ref/Bus/update.md) REST API method for the [Bus](../../../eventrouter/api-ref/Bus/index.md) resource or the [Bus/Update](../../../eventrouter/api-ref/grpc/Bus/update.md) gRPC API call.

{% endlist %}