[Yandex Cloud documentation](../../index.md) > [Yandex Cloud Logging](../index.md) > [Step-by-step guides](index.md) > Adding records

# Adding records

{% note info %}

You can create a trigger that will invoke a [function](../../functions/operations/trigger/cloud-logging-trigger-create.md) in Cloud Functions or run a [container](../../serverless-containers/operations/cloud-logging-trigger-create.md) in Serverless Containers whenever records are added to the log group.

{% endnote %}

{% list tabs group=instructions %}

- 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.

    To add records to a log group, run this command:

    * Linux, MacOS:
        ```bash
        yc logging write \
          --group-name=default \
          --message="My message" \
          --level=INFO \
          --json-payload='{"request_id": "1234"}'
        ```
    * Windows (cmd):
        ```cmd
        yc logging write ^
          --group-name=default ^
          --message="My message" ^
          --level=INFO ^
          --json-payload="{"request_id": "1234"}"
        ```
    * Windows (PowerShell):
        ```powershell
        yc logging write `
          --group-name=default `
          --message="My message" `
          --level=INFO `
          --json-payload='"{ \"request_id\": \"1234\" }"'
        ```
        
    Where:

    * `--group-name`: Name of the log group where you want to add records. If you leave it unspecified, the system will add records to the [default log group](../concepts/log-group.md) in the current folder. You can specify `--group-id` instead of `--group-name`. 
    * `--message`: Message.
    * `--level`: Logging level.
    * `--json-payload`: Additional information in JSON format.

   You can skip the `--group-name`, `--message`, and `--json-payload` parameters and provide only the values in the right order, e.g., `default "My message" '{"request_id": "1234"}'`.

   {% note info %}

   It may take up to 60 seconds for records to appear in the log group because the system needs time to process them.

   {% endnote %}

- API {#api}

  To add records to a log group, use the [LogIngestionService/Write](../api-ref/grpc/LogIngestion/write.md) gRPC API call.

{% endlist %}


### Useful links {#see-also}

- [Reading records](read-logs.md)
- [Monitoring](monitoring.md)