gcloud_logging_write (1)
NAME
- gcloud logging write - write a log entry
SYNOPSIS
-
gcloud logging write LOG_NAME MESSAGE [--payload-type=PAYLOAD_TYPE; default="text"] [--severity=SEVERITY; default="DEFAULT"] [--billing-account=BILLING_ACCOUNT_ID | --folder=FOLDER_ID | --organization=ORGANIZATION_ID] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
gcloud logging write should be used for simple testing purposes. Check Stackdriver Logging agent for a proper way to send log entries: cloud.google.com/logging/docs/agent
POSITIONAL ARGUMENTS
-
- LOG_NAME
-
Name of the log where the log entry will be written.
- MESSAGE
-
Message to put in the log entry. It can be JSON if you include
--payload-type=json.
FLAGS
-
- --payload-type=PAYLOAD_TYPE; default="text"
-
Type of the log entry payload. PAYLOAD_TYPE must be one of: text,
json.
- --severity=SEVERITY; default="DEFAULT"
-
Severity level of the log entry. SEVERITY must be one of: DEFAULT,
DEBUG, INFO, NOTICE, WARNING, ERROR,
CRITICAL, ALERT, EMERGENCY.
-
At most one of these may be specified:
-
- --billing-account=BILLING_ACCOUNT_ID
-
Write log entries associated with this billing account.
- --folder=FOLDER_ID
-
Write log entries associated with this folder.
- --organization=ORGANIZATION_ID
-
Write log entries associated with this organization.
-
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
EXAMPLES
To create a log entry in a given log, run:
- $ gcloud logging write LOG_NAME "A simple entry"
To create a high severity log entry, run:
- $ gcloud logging write LOG_NAME "Urgent message" --severity=ALERT
To create a structured log, run:
-
$ gcloud logging write LOG_NAME '{"key": "value"}' \
--payload-type=json
NOTES
This variant is also available:
- $ gcloud beta logging write