Replies: 1 comment
-
Do you want to exclude a property on your Audit Events? Which one? You could set up a custom action that removes the property before saving it, for example removing the MachineName property from the Environment: Audit.Core.Configuration.AddOnCreatedAction(scope =>
{
scope.Event.Environment.MachineName = null;
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
im trying to exclude a property and have no idea how.
I have this in my startup to setup audit.net
Audit.Core.Configuration.Setup() .UseAzureCosmos(config => config .Endpoint(Configuration.GetSection("CosmosDb").GetValue<string>("Endpoint")) .AuthKey(Configuration.GetSection("CosmosDb").GetValue<string>("Key")) .Database(Configuration.GetSection("CosmosDb").GetValue<string>("DatabaseName")) .Container("audit") .WithId(_ => Guid.NewGuid().ToString().ToLower()) .ClientOptions(options => { options.ConnectionMode = ConnectionMode.Gateway; }));
Im creating Audits inside my controller like this.
` await using (await AuditScope.CreateAsync("Asset:Update", () => customerAsset,
new {Account = customerAsset.AccountId, User = User.Identity?.Name ?? string.Empty}))
{
}`
How can I exclude a property?
Beta Was this translation helpful? Give feedback.
All reactions