Writes one of data
, text
, or json
to the log at specified severity.
The log is written using the Cloud Logging API, the workflows.googleapis.com/Workflow
resource, and under the log name projects/${GOOGLE_CLOUD_PROJECT_ID}/logs/Workflows
.
For more information, see Send logs to Cloud Logging .
Arguments
data
integer|float|bool|string|list|dict
The log message. Maps are logged as a JSON payload and stored in the jsonPayload
field of the log entry. Other accepted types are logged as a text payload and stored in the textPayload
field of the log entry.
severity
string
One of: DEFAULT
, DEBUG
, INFO
, NOTICE
, WARNING
, ERROR
, CRITICAL
, ALERT
, EMERGENCY
(default: DEFAULT
).
text
integer|float|bool|string|list|dict
The log message. Always logged as a text payload and stored in the textPayload
field of the log entry.
json
dict
The map to be logged as a JSON payload and stored in the jsonPayload
field of the log entry.
timeout
double
The timeout of the log call.
Raised exceptions
TypeError
- If either
dataortextis specified with a type that is not one ofinteger,float,bool,string,list, ordict. - If
jsonis specified with a type that is notdict. - If more than one of
data,text, orjsonare specified. - If none of
data,text, orjsonare specified.
TimeoutError
Examples
Auto-detect payload
- assignStep : assign : - myVar : "Log my error message" - argsMap : call : sys.log args : data : ${myVar} severity : "ERROR" # Optional - argsList : call : sys.log args : [ $ { myVar }, "ERROR" ] # Sample output: # { # "textPayload": "Log my error message", # ... # "severity": "ERROR", # ... # }
Text payload
- assignStep : assign : - myVar : "Log my error message" - argsMap : call : sys.log args : text : ${myVar} severity : "ERROR" # Optional - argsList : call : sys.log args : [ $ { null }, "ERROR" , $ { myVar }] # Sample output: # { # "textPayload": "Log my error message", # ... # "severity": "ERROR", # ... # }
JSON payload
- createMap : assign : - myMap : { "Message1" : "Log my error message" } - argsMap : call : sys.log args : json : ${myMap} severity : "ERROR" # Optional - argsList : call : sys.log args : [ $ { null }, "ERROR" , $ { null }, $ { myMap }] # Sample output: # { # ... # "jsonPayload": { # "Message1": "Log my error message" # }, # ... # "severity": "ERROR", # ... # }

