Community Connector Logger.log doesn't parse severity field provided in jsonPayload

Viewed 63

I'm trying to log JSON Objects from my Google Apps Script - Data Studio Community Connector code to Stackdriver Logging as described in the official doc

Using console.log(jsonObject) the jsonObject is converted to string. It doesn't work.

Using Logger.log(jsonObject) instead, the jsonObject y parsed inside de jsonPayload property of the log entry. Good.

But all log entries are inserted with INFO severity level.

If I include the severity property inside de jsonObject, the severity is not parsed as expected.

I tried a few options including the severity as string "ERROR" or a number 500 but it doesn't work.

Some examples I tried from my Community Connector Code:

Logger.log({
  message: 'This is the message / title for the log entry. Works fine',
  severity: 'ERROR',
  otherData: {
    userId: '459',
    connectorType: 'blahblah',
    includeFilters: true
  }
});

OR

Logger.log({
  message: 'This is the message / title for the log entry. Works fine',
  severity: 500,
  otherData: {
    userId: '459',
    connectorType: 'blahblah',
    includeFilters: true
  }
});

As you can see, the severity property never gets parsed as the severity level. enter image description here

enter image description here

enter image description here

0 Answers
Related