Skip to content

SUMO_ENHANCE_JSON_LOGS has opposite functionality #23

@lopezm1

Description

@lopezm1

Description

The environment variable SUMO_ENHANCE_JSON_LOGS=false is doing the opposite of it's documented usage.

According to the release page:

Introduced a new environment variable SUMO_ENHANCE_JSON_LOGS which by default is set to true. If the feature switch is set to false then the message sent to SumoLogic will not contain any addition metadata only the actual log message.

Steps to Reproduce

Set your environment variables for lambda functions:

  REGION: ${self:provider.region}
  SUMO_ENHANCE_JSON_LOGS: true
  SUMO_HTTP_ENDPOINT: ${self:custom.sumo-http-endpoint}
  SUMO_LOG_TYPES: function

Add the following layer to your lambda:

arn:aws:lambda:${self:provider.region}:956882708938:layer:sumologic-extension-amd64:7

Expected Behavior

I would expect the logs to look like this:

{"message":{"asctime":"2023-07-18 23:18:13,355","funcName":"send","levelname":"INFO","message":"GET / 200","module":"http"}}

No extra metadata from the lambda, only a log message.

Relevant Logs / Console output

Instead, the logs contain anything but the message and they look like this:

{"IsColdStart":false,"LayerVersion":"sumologic-extension-prod:7","logGroup":"/aws/lambda/tcr-service-fastapi-lambda-dev-apiPublic","logStream":"2023/07/18/[$LATEST]sumologic-extension","time":"2023-07-18T23:18:13.356Z","type":"function"}

Your Environment

Layer version: arn:aws:lambda:${self:provider.region}:956882708938:layer:sumologic-extension-amd64:7
RunTime: Python3.9
Timeout and other Environment Variables

  REGION: ${self:provider.region}
  SUMO_ENHANCE_JSON_LOGS: true
  SUMO_HTTP_ENDPOINT: ${self:custom.sumo-http-endpoint}
  SUMO_LOG_TYPES: function

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions