Skip to content

Conversation

@aswanson08
Copy link

Modified the global enable to allow a finer degree of control if needed. This branch allows global enabling/disabling of adds, deletes, or modifications individually. For example, if audit logs are only needed when a record is modified or deleted, but there is no need to log when a record is added, simply add the following line to your setup:

GlobalTrackingConfig.AdditionsEnabled = false;

You can also do this through any instance of ITrackerContext as well, as shown:

trackerContext.AdditionTrackingEnabled = false;

The original Enabled property on the GlobalTrackingConfig and the TrackingEnabled property on the TrackerContext can be used to enable/disable all three types of logs at once, and when read will tell you if at least one of the three types of logs is enabled.

@asulwer
Copy link
Contributor

asulwer commented Jul 24, 2018

I am manually merging this into the EF Core 2 branch I have been working on

asulwer added a commit to asulwer/tracker-enabled-dbcontext that referenced this pull request Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants