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

Invalid logging level specified: null on v1.10.0 #123

Closed
cdubz opened this issue Dec 13, 2022 · 3 comments
Closed

Invalid logging level specified: null on v1.10.0 #123

cdubz opened this issue Dec 13, 2022 · 3 comments

Comments

@cdubz
Copy link

cdubz commented Dec 13, 2022

After upgrading from v1.9.0 to v1.10.0 I'm seeing an error Invalid logging level specified: null when attempting to deploy an application.

Here is what my serverless.yml file looks like.

service: [...]

plugins:
  - serverless-webpack
  - serverless-offline
  - serverless-domain-manager
  - serverless-api-gateway-caching
  - serverless-stack-termination-protection

provider:
  name: aws
  runtime: nodejs14.x
  region: us-west-2
  stage: dev
  logRetentionInDays: 30
  timeout: 10
  environment:
    [...]
  apiGateway:
    apiKeys:
      [...]
    shouldStartNameWithService: true

custom:
  stage: ${opt:stage, self:provider.stage}
  ssmPrefix: /${self:service}/${self:custom.stage}
  apiGatewayCaching:
    enabled: true
  customDomain:
    domainName: [...]
    certificateName: [...]
    basePath: "v1"
    stage: ${self:custom.stage}
    createRoute53Record: true
    autoDomain: true

functions:
  [...]

resources:
  Resources:
    [...]

I have tested updates to the other configured plugins individually and the issue does not occur. It only comes up when upgrading serverless-api-gateway-caching to v1.10.0.

It looks like this is caused by this change from #122. In my case none of my methods have a log level set (and I'm kind of unclear where in the YAML that setting would go?).

In theory a workaround would be to set custom.apiGatewayCaching.inheritCloudWatchSettingsFromStage to false though I have not tested that yet.

@DianaIonita
Copy link
Owner

Hi @cdubz,

Thank you for reporting the issue! I was able to reproduce it and released a fix in v1.10.1.
Please let me know if you're still having trouble.

@DianaIonita
Copy link
Owner

In my case none of my methods have a log level set (and I'm kind of unclear where in the YAML that setting would go?).

You can configure that at stage level using vanilla serverless (reference), for example:

provider:
  name: aws
  apiGateway:
    metrics: true
  logs:
   restApi:
     level: INFO
     accessLogging: true
     executionLogging: true
     fullExecutionData: true

@cdubz
Copy link
Author

cdubz commented Dec 15, 2022

Tested and working. Thanks for the fix!

And thanks for the info re: where to configure this -- I was confused about where to add the default logging configuration when trying to troubleshoot.

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

2 participants