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

So/review sentry exception logging in the api #1498

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

spanersoraferty
Copy link

I've limited the use of the correlation ID to the teacher advisor sign-up endpoint (as discussed) to limit the potential for issues if any problems occur. I've also not been able to best the filter attribute, it is possible but I cannot mock the hangfire context because they've neglected to apply interfaces, or make class methods generic. We could use a library like Typemock but not sure if this will play nicely with the CICD pipeline out of the box.

If theses changes prove stable we can raise a second, follow-on ticket to complete the work to apply this logging behaviour across the remaining endpoints.

@spanersoraferty spanersoraferty deployed to development_aks January 28, 2025 15:16 — with GitHub Actions Active
@github-actions github-actions bot added VisualCSharp Visual C # Test Test scripts and harnesses labels Jan 28, 2025
}

_logger.LogInformation("UpsertCandidateJob - Started ({Attempt})", AttemptInfo(context, _contextAdapter));
_logger.LogInformation("UpsertCandidateJob - Payload {Payload}", Redactor.RedactJson(json));
_logger.LogInformation("UpsertCandidateJob - Started ({Attempt}) {CorrelationId}", AttemptInfo(context, _contextAdapter), correlationId);
Copy link
Contributor

@martyn-w martyn-w Jan 29, 2025

Choose a reason for hiding this comment

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

could the correlation Id be made more prominent in the log so it is easy to distinguish from all the other GUIDs? How about:

  • CID-162cdb97-32ba-4efc-b7f8-7a2ad87b8d39
  • [162cdb97-32ba-4efc-b7f8-7a2ad87b8d39]
  • (162cdb97-32ba-4efc-b7f8-7a2ad87b8d39)

Copy link
Author

Choose a reason for hiding this comment

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

No problem, happy to do whatever you think may help. Leave it with me and I'll send you the output once I've applied the change to see if things look right.

@@ -10,9 +10,18 @@
"WriteTo": [
{
"Name": "Console"
},
{
"Name": "File",
Copy link
Contributor

Choose a reason for hiding this comment

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

could this be a local dev setting, rather than in the main app settings? I don't think this will work on production

Copy link
Author

Choose a reason for hiding this comment

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

Actually, this should be removed. Thought I had, leave it with me and I'll sort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Test scripts and harnesses VisualCSharp Visual C #
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants