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

Add option to change log level for websocket logs #7035

Merged
merged 2 commits into from Dec 3, 2019
Merged

Add option to change log level for websocket logs #7035

merged 2 commits into from Dec 3, 2019

Conversation

tinexw
Copy link
Contributor

@tinexw tinexw commented Dec 2, 2019

What did you implement

Add option to change the log level of websocket logs to ERROR. Note that I did not add an option to disable logs on purpose in order to keep the change small.

How can we verify it

service: serverless-ws-test

provider:
  name: aws
  logs:
    websocket:
      level: ERROR
  runtime: nodejs12.x
  websocketsApiName: custom-websockets-api-name

functions:
  connectionHandler:
    handler: handler.connectionHandler
    events:
      - websocket:
          route: $connect
  defaultHandler:
    handler: handler.defaultHandler
    events:
      - websocket: $default
  1. Run sls deploy
  2. Open the Logs/Tracing settings of the API gateway.
  3. Should look like this: Screen Shot 2019-12-02 at 23 28 21
  4. Change level: ERROR to level: INFO in the serverless.yml
  5. Check that the Log Level in the Logs/Tracing settings was changed to INFO

Todos

Useful Scripts
  • npm run test-ci --> Run all validation checks on proposed changes
  • npm run lint-updated --> Lint all the updated files
  • npm run lint:fix --> Automatically fix lint problems (if possible)
  • npm run prettier-check-updated --> Check if updated files adhere to Prettier config
  • npm run prettify-updated --> Prettify all the updated files
  • Write and run all tests
  • Write documentation
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@codecov-io
Copy link

codecov-io commented Dec 2, 2019

Codecov Report

Merging #7035 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #7035      +/-   ##
=========================================
- Coverage    88.5%   88.5%   -0.01%     
=========================================
  Files         229     230       +1     
  Lines        8428    8461      +33     
=========================================
+ Hits         7459    7488      +29     
- Misses        969     973       +4
Impacted Files Coverage Δ
...aws/package/compile/events/websockets/lib/stage.js 100% <100%> (ø) ⬆️
.../compile/events/apiGateway/lib/hack/updateStage.js 95.89% <0%> (-0.54%) ⬇️
lib/plugins/aws/customResources/index.js 98.52% <0%> (-0.14%) ⬇️
lib/plugins/aws/invokeLocal/index.js 76.36% <0%> (ø) ⬆️
lib/plugins/aws/customResources/generateZip.js 88.46% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd93739...093cd4e. Read the comment docs.

Copy link
Contributor

@pmuens pmuens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thanks for working on this @tinexw 👍

I just tested it and it works as expected. I updated the serverless.yml doc reference. I'd say it's GTM :shipit:

@pmuens pmuens added this to the 1.59.0 milestone Dec 3, 2019
@pmuens pmuens merged commit e080dd2 into serverless:master Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants