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

Detailed global enable #141

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

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