Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ilanc opened this issue Sep 14, 2020 · 0 comments
Open

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

ilanc opened this issue Sep 14, 2020 · 0 comments

Comments

@ilanc
Copy link

ilanc commented Sep 14, 2020

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);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant