Adding records
Note
CLI
API
If you do not 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.
To add records to a log group, run this command:
-
Linux, MacOS:
yc logging write \ --group-name=default \ --message="My message" \ --level=INFO \ --json-payload='{"request_id": "1234"}'
-
Windows (cmd):
yc logging write ^ --group-name=default ^ --message="My message" ^ --level=INFO ^ --json-payload="{"request_id": "1234"}"
-
Windows (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 to add records to. If this parameter is not specified, records are added to the default log group in the current folder. You can also specify--group-id
instead of--group-name
.--message
: Message.--level
: Logging level.--json-payload
: Additional information in JSON format.
Note
You can skip the --group-name
, --message
, and --json-payload
flags and specify only the parameter values, keeping the order, e.g., default "My message" '{"request_id": "1234"}'
.
To add records to the log group, use the LogIngestionService/Write gRPC API call.