Hi all!
After looking at https://docs.apigee.com/api-platform/reference/extensions/google-stackdriver-logging/google-stackdri... we struggled to correctly set the severity of a log message.
Any thoughts?
Thanks! Sean
Solved! Go to Solution.
Hey mate, you need to set it in Stack Driver callout policy payload like this (its a json so format the payload so you can read). Let me know if you have any issues.
<Input><![CDATA[{ "logName": "projects/{stackdriver.projectid}/logs/{stackdriver.logid}", "metadata": { "httpRequest": { }, "resource": { "type": "api", "labels": { "location": "{request.uri}", "method": "{request.verb}", "service": "{apiproxy.name}", "version": "{apiproxy.revision}", "requestUrl": "{request.uri}" } }, "severity": "{severity}", "trace": "{iconRequestId}", "textPayload": "{logMessage}" }, "message": "{severity} {logMessage}" }]]></Input>
Hey mate, you need to set it in Stack Driver callout policy payload like this (its a json so format the payload so you can read). Let me know if you have any issues.
<Input><![CDATA[{ "logName": "projects/{stackdriver.projectid}/logs/{stackdriver.logid}", "metadata": { "httpRequest": { }, "resource": { "type": "api", "labels": { "location": "{request.uri}", "method": "{request.verb}", "service": "{apiproxy.name}", "version": "{apiproxy.revision}", "requestUrl": "{request.uri}" } }, "severity": "{severity}", "trace": "{iconRequestId}", "textPayload": "{logMessage}" }, "message": "{severity} {logMessage}" }]]></Input>
thanks Ahmed!
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |