question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What Id can I use when correlating changes across entities.

See original GitHub issue

I am trying to gather up all audit rows that happened as a result of the same request. I am not using transactions at the moment, but my DbContext is a scoped dependency so I can I rely on ConnectionId?

Or, should I be passing a custom CorrelationId down all my layers every time?

Should I maybe add transactions to all my requests so I have the TransactionId? Or will that cause me great pain when it comes to scoped transactions/distributed transactions?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
thepirat000commented, Jan 28, 2019

It looks good to me.

If you are in a ASP.NET Core Web API, you could use the HttpContext.TraceIdentifier value (a unique value per request). So you can add this correlation ID to the events via a Custom Action.

But I would recommend to also activate the audit logging for the controller actions(s) with Audit.WebApi library. It will generate audit events for each call to your API, including the TraceIdentifier.

Take a look at the web api template provided. You can install the template with:

dotnet new -i Audit.WebApi.Template

And then you can generate a project that uses both Audit.WebApi and Audit.EntityFramework both including the correlation:

dotnet new webapiaudit -E

0reactions
thepirat000commented, Jan 30, 2019

for further discussion we can better use the gitter chat channel: https://gitter.im/Audit-NET/Lobby

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure correlation logic with decisions
The basic decision builder covers the majority of use cases and focuses on "correlate by attribute," where you can specify filter conditions for...
Read more >
Panel Data Analysis Fixed and Random Effects using Stata
Once the data is set as panel, you can use a series of xt commands to analyze it. ... Variables that do not...
Read more >
What is identity lifecycle management? - Azure
A digital identity is information on an entity used by one or more computing resources, such as operating systems or applications.
Read more >
Auditing Standard No. 5
Introduction. 1. This standard establishes requirements and provides direction that applies when an auditor is engaged to perform an audit of management's ...
Read more >
FinCEN_Guidance_CDD_FAQ_...
What process should a covered financial institution use to identify and verify the identity of a beneficial owner of a legal entity customer ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found