cds-snc / report-a-cybercrime

Report a computer crime or scam / Signaler un crime informatique ou une fraude
https://report-a-scam.cds-snc.ca
MIT License
29 stars 14 forks source link

client log to server and ErrorBoundary #2412

Closed sdzhangtao closed 4 years ago

sdzhangtao commented 4 years ago

Fixes #(issue) Client is not able to log infomation and error messages to server, they lost with the client's browser. When the app crashes, we don't have a trace. Client logs are not associated to each other server side logs are not associated to each other It's also nicer to have an Error Page instead of a blank screen in case there are rendering error

Description

Client logs are associated with a new session id At submit time, the session id will be passed to server server logs are associated with existing report id

Please include a summary of the change. Use existing winston logger, but works at client using winston HTTP transport to log to server Generate new session id Use React Error Boundar

Any new packages installed?

No Give details

Required followup work

Will have to design a new Error Page.

Is there anything related to this that still needs to be done (ex: documentation changes).

Checklist:

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging 06dea3de82166c8d2b9d82db46e02f638f2d4f89 into 120431cfc76effcee1536f8c3490d4d893e982d2 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging bddd20bd43b7a19744feab0dd2f6d8b88a9a41fe into 120431cfc76effcee1536f8c3490d4d893e982d2 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging 72ed48a758ec464fa1ced1a53093b684ffe313be into 83b69ff6a235b60685557e6392f20e5d5f32d349 - view on LGTM.com

new alerts:

justinr86 commented 4 years ago

I like this feature, we should probably remove the console.log messages from Landing Page.

The only problem I see is the error and info messages are difficult to read, but this could be addressed in a subsequent update.

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging 238b89cd6818e388cdb35af923589c84daf97a40 into f2bc02ff1ab65534a1741f3e00e6d07ca1ccfb1d - view on LGTM.com

new alerts:

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging a6dbe4f7f7e37bd93abf50d574064bdc70913733 into f2bc02ff1ab65534a1741f3e00e6d07ca1ccfb1d - view on LGTM.com

new alerts:

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging 1e7a49d3d59b2e1a34d7bc93c04a13248f1e76f8 into f2bc02ff1ab65534a1741f3e00e6d07ca1ccfb1d - view on LGTM.com

new alerts:

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging b71a79a988e4d551ddbd15c1467e4c1be261ad39 into f2bc02ff1ab65534a1741f3e00e6d07ca1ccfb1d - view on LGTM.com

new alerts:

sdzhangtao commented 4 years ago

I like this feature, we should probably remove the console.log messages from Landing Page.

The only problem I see is the error and info messages are difficult to read, but this could be addressed in a subsequent update.

I removed the console.log. That's easy. Do you mean formatted json for easy reading? For logging to analytics, one liner is preferable than formatted I read.

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging 8065965e46be1cbd972b6c70b136969d1b73f16c into 03a5182c8091be16d31678599c00cc781e97624e - view on LGTM.com

new alerts:

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging b7a4a47d4e61d9a24f7f64da9e1cebe10b5d0832 into 03a5182c8091be16d31678599c00cc781e97624e - view on LGTM.com

new alerts:

justinr86 commented 4 years ago

I like this feature, we should probably remove the console.log messages from Landing Page. The only problem I see is the error and info messages are difficult to read, but this could be addressed in a subsequent update.

I removed the console.log. That's easy. Do you mean formatted json for easy reading? For logging to analytics, one liner is preferable than formatted I read.

Yes, I was referring to formatted JSON for viewing in console. This makes sense.

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging a3c83ba0835b6db66ac84860d488c29369b535db into ad3d99b1d4b608637f877ee301412c425a43fc1f - view on LGTM.com

new alerts:

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging 6377a88b59bb19bd27a71366904e0fe0fd0a0daa into 936acdfe54ff8dea6d33ba5b9798b8122e7b727d - view on LGTM.com

new alerts:

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging 4b7346216c6636f8b1a61274da94dff2294d0068 into d2fe7e6c2f247cabcbf4c7994e5842bb57fa8aa1 - view on LGTM.com

new alerts: