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

feat(middleware-logger): log clientName, commandName, input, output #1788

Merged
merged 7 commits into from
Dec 16, 2020

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Dec 14, 2020

Issue #, if available:
Fixes: #1785

Removal of logging clientName and commandName is tracked in:

Description of changes:
log clientName, commandName, input, output in addition to metadata

Test Code
const { DynamoDB } = require("../aws-sdk-js-v3/clients/client-dynamodb");

(async () => {
  const region = "us-east-1";
  const logger = console;
  const client = new DynamoDB({ region, logger });

  await client.listTables({ Limit: 1 });
})();
Test output
{
  clientName: 'DynamoDBClient',
  commandName: 'ListTablesCommand',
  input: { Limit: 1 },
  output: {
    LastEvaluatedTableName: undefined,
    TableNames: [ 'aws-js-sdk-workshop-notes' ]
  },
  metadata: {
    statusCode: 200,
    requestId: 'CQETJIBBCE0Q84EA4SDIC06JQBVV4KQNSO5AEMVJF66Q9ASUAAJG',
    extendedRequestId: undefined,
    cfId: undefined,
    retry: { attempts: 1, totalDelay: 0 },
  }
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr changed the title chore(middleware-logger): log clientName, commandName, input, output in addition to metadata chore(middleware-logger): log clientName, commandName, input, output Dec 14, 2020
@trivikr trivikr changed the title chore(middleware-logger): log clientName, commandName, input, output chore(middleware-logger): log clientName, commandName, input, output, retry Dec 14, 2020
@trivikr trivikr changed the title chore(middleware-logger): log clientName, commandName, input, output, retry chore(middleware-logger): log clientName, commandName, input, output Dec 14, 2020
@trivikr trivikr changed the title chore(middleware-logger): log clientName, commandName, input, output feat(middleware-logger): log clientName, commandName, input, output Dec 14, 2020
@codecov-io
Copy link

codecov-io commented Dec 14, 2020

Codecov Report

Merging #1788 (8946d28) into master (de75f7e) will decrease coverage by 1.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1788      +/-   ##
==========================================
- Coverage   79.77%   78.71%   -1.07%     
==========================================
  Files         325      362      +37     
  Lines       12087    15295    +3208     
  Branches     2553     3331     +778     
==========================================
+ Hits         9643    12040    +2397     
- Misses       2444     3255     +811     
Impacted Files Coverage Δ
protocol_tests/aws-json/models/models_0.ts 79.36% <0.00%> (-20.64%) ⬇️
protocol_tests/aws-restjson/models/models_0.ts 89.43% <0.00%> (-10.57%) ⬇️
...tocol_tests/aws-restxml/commands/XmlMapsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ocol_tests/aws-restxml/commands/XmlBlobsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ocol_tests/aws-restxml/commands/XmlEnumsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ocol_tests/aws-restxml/commands/XmlListsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...col_tests/aws-restjson/commands/JsonMapsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ol_tests/aws-restjson/commands/JsonBlobsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ol_tests/aws-restjson/commands/JsonEnumsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ol_tests/aws-restjson/commands/JsonListsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
... and 178 more

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 54e8715...8946d28. Read the comment docs.

@trivikr trivikr merged commit 4f9e56f into aws:master Dec 16, 2020
@trivikr trivikr deleted the log-everything-in-logger-middleware branch December 16, 2020 00:55
@github-actions
Copy link

github-actions bot commented Jan 8, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logger should log clientName, commandName, input, output, metadata in one entry
3 participants