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 example for request id logging #24

Merged

Conversation

silwalanish
Copy link
Member

@silwalanish silwalanish commented Sep 20, 2019

Resolves #16

  • Add a simple logging service
    • Log info/debug with a unique request id prepended.

Output

[ DEBUG ] [ 4d5fc07c ] Received a: 20
[ DEBUG ] [ 4d5fc07c ] Received b: 30
[ INFO  ] [ 4d5fc07c ] Simulating delay
[ DEBUG ] [ 4d5fc07c ] Calculated sum: 2030
[ DEBUG ] [ b3862126 ] Received a: 10
[ DEBUG ] [ b3862126 ] Received b: 50
[ INFO  ] [ b3862126 ] Simulating delay
[ DEBUG ] [ b3862126 ] Calculated sum: 1050
[ DEBUG ] [ 40f72e60 ] Received a: 50
[ DEBUG ] [ 40f72e60 ] Received b: 100
[ INFO  ] [ 40f72e60 ] Simulating delay
[ DEBUG ] [ 40f72e60 ] Calculated sum: 50100
[ INFO  ] [ 4d5fc07c ] Delay end
[ INFO  ] [ b3862126 ] Delay end
[ INFO  ] [ 40f72e60 ] Delay end

@codecov-io
Copy link

codecov-io commented Sep 20, 2019

Codecov Report

Merging #24 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #24   +/-   ##
======================================
  Coverage    69.1%   69.1%           
======================================
  Files           5       5           
  Lines         123     123           
  Branches       19      19           
======================================
  Hits           85      85           
  Misses         31      31           
  Partials        7       7

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 51414d6...2ae6e83. Read the comment docs.

Copy link
Member

@mesaugat mesaugat left a comment

Choose a reason for hiding this comment

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

Looks good from my side. @silwalanish 💯

I'll let @kabirbaidhya handle the rest. 🙏

@kabirbaidhya
Copy link
Contributor

Looks all good @silwalanish 💯 👍

@kabirbaidhya kabirbaidhya merged commit e899695 into leapfrogtechnology:master Sep 25, 2019
@silwalanish silwalanish deleted the add-request-id-logging branch September 30, 2019 05:29
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.

Example with request id logging for express sample app
5 participants