Questions tagged [audit.net]

An extensible framework to audit executing operations in .NET

An extensible framework to audit executing operations in .NET including support for .NET Framework 4.5 and Net Core.

With Audit.NET you can generate tracking information about operations being executed. Logs environmental information such as the caller user id, machine name, method name, exceptions, including execution time and duration.

Extensions to log to json Files, Event Log, SQL, MySQL, MongoDB, AzureBlob, PostgreSQL, Redis, Elasticsearch and CosmosDB are provided. And also extensions to audit different systems such as EntityFramework, MVC, WebAPI, SignalR and WCF.

Project site

121 questions
2
votes
0 answers

Is a more generic solution possible?

I think what I want to do is not possible. However, I would like to make sure that it is indeed not possible. I use Audit.Net as a framework to add auditing to a system that has already been completed. There are many different objects that may be…
Igavshne
  • 699
  • 7
  • 33
2
votes
1 answer

Auditing n to m relationships in Audit.NET (DB-first)

I'm adding Audit.NET/EF to a legacy DB-first project. (It uses an edmx file built from the database schema to generate the domain model.) The DB has a many-to-many relationship between table A and table B modeled as usual with a linking table A_B. …
MrBlueSky
  • 728
  • 6
  • 20
2
votes
1 answer

Audit.NET Entity Framework to audit one same entry to two tables

I Have 2 Audit tables one is Audit_ProfileFan and second is Audit_StatusChanges The first table AuditProfileFan should audit every time update or insert has been made to ProfileFan Table. The second Audit_StatusChanges should only audit when an…
nightowl
  • 309
  • 1
  • 3
  • 13
2
votes
1 answer

Audit.Net: Process of saving in different dataprovider

Is it possible to establish some mechanism so that in case the insertion of the audit fails in the default dataprovider, oracle for example, another data provider is used, for example in a file? Thanks for the help
2
votes
2 answers

How To Save Entity Relations With Audit.Net?

I am using Audit.Net (Audit.EntityFramework) and I want to know how can I save an entity's relation? Here's my configuration Audit.Core.Configuration.Setup() .UseEntityFramework(x => x .AuditTypeMapper(typeName =>…
Masoud Darvishian
  • 3,754
  • 4
  • 33
  • 41
2
votes
1 answer

New Object missing if not using Data Provider - Audit.Net

I notice the AuditScope got .Event properties which contains the value the event logs. So it can convert to json by using this command var Scope = AuditScope.Create("Account:Suspend", () => user); //Change value properties on user object //Save…
Azri Zakaria
  • 1,324
  • 5
  • 23
  • 52
2
votes
1 answer

AuditIgnore on IdentityUser - Audit.Net

I'am using the Audit.Net to track the changes. Very good libray By using Audit.EntityFramework extension, we can ignore the properties to be track. public class User { public int Id { get; set; } [AuditIgnore] public string Password {…
Azri Zakaria
  • 1,324
  • 5
  • 23
  • 52
2
votes
1 answer

Is it possible to configure everything within context?

I am trying to configure Audit.net and define my custom logic for saving logs. Is there a way to configure included entities within context? I tried this ` public ResidentMasterContext(DbContextOptions options) : base(options) { AuditDataProvider…
2
votes
0 answers

Audit.EntityFramework with Simple Injector On .Net Core

I'm currently using .net core 2.0 along with Audit.EntityFramework to audit changes on my entities. I've gone the route of creating my own CustomProvider as explained here DataProviders brief excerpt below. EmployerCustomDataProvider public class…
Darren
  • 335
  • 2
  • 11
2
votes
1 answer

Audit.net Audit.MVC output to json and not json file

Hey all this is the first time I am using an thepirat000 Audit.MVC package and I have the base down and working just fine: [Audit(EventTypeName = "InsertOrderAction", IncludeHeaders = true, IncludeModel = true)] public ActionResult Index() { …
StealthRT
  • 10,108
  • 40
  • 183
  • 342
2
votes
3 answers

Audit trail with Entity Framework Core

I have an ASP.NET core 2.0 using Entity Framework core on a SQL Server db. I have to trace and audit all the stuff made by the users on the data. My goal is to have an automatic mechanism writing all what is happening. For example, if I have the…
1
vote
0 answers

HttpContext.Response.Body is empty while running ASP.NET Core 6 app on IIS using Audit.NET middleware

I have a ASP.NET Core 6 REST API application, installed on the on-premise server with IIS. In one of the environments, about 20% of queries fail due to an empty HttpContext.Response.Body object. I use Audit.NET for logging requests and…
Pawel
  • 21
  • 1
  • 3
1
vote
0 answers

Audit.EntityFramework.Core how to store changes to multiple tables without creating audit objects

iam using Audit.EntityFramework.Core library to setup audit log in my new application. Following guide i setup my dbContext (see below code) but from what i can understand it seems that i have to create in my domain a specific object for every real…
gt.guybrush
  • 1,320
  • 3
  • 19
  • 48
1
vote
2 answers

Audit.EntityFramework: SqlException: Cannot insert explicit value for identity column

Entity Framework Core .NET 7 SQL Server Error: Cannot insert explicit value for identity column in table 'AuditLogs' when IDENTITY_INSERT is set to OFF. Info: Identity Insert is set to ON My Column is Identity(1,1) PRIMARY KEY This is my first…
1
vote
1 answer

Set Correct Username for Audit.NET logs

I am setting up Audit.NET using the below configuration Configuration.Setup() .UseEntityFramework(_ => _ .AuditTypeMapper(t => typeof(AuditLog)) .AuditEntityAction((ev, entry, entity) => { entity.AuditData =…
Aishwarya
  • 242
  • 1
  • 2
  • 13
1 2
3
8 9