Skip to content

help request: not seeing any data in the "Server log"  #415

@ilanc

Description

@ilanc

Howdy,
This tool looks great! I'm just trying it out for the first time - sorry for the noob questions. I'm struggling to get cloudwatch logs to feed into Server Log. I've tried setting the --start-time but no dice. I can list the lambda, invoke it from sls-dev-tools (and see the result in Dashboard Logs), and see stats - but the data is not feeding through.

How can I debug it?

What I've tried

  • fiddling with start time
    • sls-dev-tools -r eu-west-2 -n sls-dev-tools-test-prod -t '10 September 2020 00:00 GMT'
  • deploying to different regions (none working): eu-west-2, us-west-1, af-south-1
  • confirmed that cloudwatch logs are present = check
    CWLOG=/aws/lambda/sls-dev-tools-test-prod-hello && aws logs describe-log-streams --log-group-name $CWLOG | jq -r .logStreams[].logStreamName | tr '\n' '\0' | xargs -0 -n1 aws logs get-log-events --log-group-name $CWLOG --log-stream-name | jq -j ".events[].message"
    # returns logs correctly
  • multiple sls-dev-tools versions:
    • tried latest 2: 1.1.10 & 1.1.8

More info on my environment

  • lambda
    • deployed using serverless
    • regions: eu-west-2, us-west-1, af-south-1
  • os
    • Ubuntu 18.04.5 LTS
  • serverless
    • Framework Core: 2.0.0. Plugin: 4.0.2, SDK: 2.3.1, Components: 3.1.2
  • node = v14.1.0

lambda source

serverless.yml
service: sls-dev-tools-test

provider:
  name: aws
  runtime: nodejs12.x
  region: eu-west-2
  stage: prod

functions:
  hello:
    handler: hello.get
hello.js
exports.get = function (event, context, callback) {
  console.log(JSON.stringify({ event, context }, null, 2));
  const response = {
    statusCode: 200,
    body: JSON.stringify({
      event,
      context,
      message: "hi world",
    }),
  };
  callback(null, response);
};

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