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
6
votes
3 answers

How can I populate my audit log UserId field when I don't have access to HttpContext?

I have a solution with two projects, my API layer and my Data layer. The Data layer is using Entity Framework, and does not know about ASP.NET WebApi. The API layer is using ASP.NET WebApi. I am planning on using Audit.NET to audit record…
JH-Sen-Ren
  • 259
  • 2
  • 12
5
votes
1 answer

Audit.NET Entity Framework Core - Related Entities management

I'm working on an ASP.NET Core 3.1 web app. I'd like to add Audit trails/logs when persisting data on the database. I took inspiration from this SO answer to start working with Audit.NET in a test project. Here are my goals (similar to the related…
m.phobos
  • 283
  • 1
  • 3
  • 12
5
votes
1 answer

Audit.net data models example

Does any one have a working example of how to added audit models to an existing project, for Audit.Net. It is one fantastic component to use, and up until now, my team and I have gotten by with the standard JSON files, however, we'd like to migrate…
JadedEric
  • 1,943
  • 2
  • 26
  • 49
4
votes
2 answers

Query JSON in C# from a SQL Server

I used Audit.Net to audit my ASP.NET Razor Application and the results are stored in JSON format in a SQL Server Database. The name of the table is called AuditTrail and the JSON results are stored in a column called JsonData A typical JSON output…
aasonu
  • 95
  • 4
  • 11
4
votes
2 answers

Audit.NET connected object save issue

I'm using Audit.NET with the EntityFramework extension, and everything was running fine when I was tracking just 1 entity. Now I'm tracking another entity as well that is connected to that first entity, and when I try to save it, the audit save…
Firenter
  • 301
  • 3
  • 14
4
votes
1 answer

Entity Framework Core updating unchanged fields

I'm not sure if this is a question about Entity Framework, or how the audit.net library works, but I was guessing it was with how I was performing updates with EF. My goal is to capture only actual changes to the record, but it's capturing…
Chris
  • 679
  • 1
  • 11
  • 26
4
votes
3 answers

Third-party implementation of DbContext, how to also implement IdentityDbContext

I'm working with Audit.NET, an open-source auditing framework, which provides an extension for Entity Framework and DbContext here: AuditDbContext.cs // Implements DbContext public abstract partial class AuditDbContext : DbContext I'd like to…
trnelson
  • 2,715
  • 2
  • 24
  • 40
3
votes
1 answer

Using Audit.NET SqlDataProvider with Azure SQL and Managed Identity

We are using the Audit.NET SqlServer Data Provider to store Audit logs in our Microsoft SQL Server. We are currently in the progress of migrating to the use of Azure SQL with Managed Identity to access the database. We haven't been able to get…
3
votes
0 answers

EFCore 3 insert large entity, Audit.net throws out of memory exception

I have some logic that creates a bunch of records based on a start and end dates. When creating these entities they get added to the collection of their parent entity. Needless to say, this can easily explode from a few entities total to a few…
ChampChris
  • 1,565
  • 5
  • 26
  • 44
3
votes
2 answers

How do I use Audit.NET Entity Framework Data Provider to save Audit.NET WebAPI audit logs?

I am having difficulty understanding the documentation for the Audit.NET Entity Framework Data Provider, to save Audit.NET WebAPI audit logs to my database. This is how I have my Audit configuration set, just to test. I have a breakpoint inside the…
JH-Sen-Ren
  • 259
  • 2
  • 12
3
votes
1 answer

In Audit.Net is there a way to use multiple output provider?

I tried setting up the configuration below however, I think only one of them is being used. Is there a way to chain the two or is there any other way to use multiple output provider? Audit.Core.Configuration.Setup() …
Cante Ibanez
  • 291
  • 1
  • 3
  • 12
3
votes
1 answer

How do I target another database with Audit.Net - Audit.EntityFramework.Core

I'm trying to implement the Audit.EntityFramework.Core package from the Audit.Net repository but am running into some difficulty. I'm unable to save changes or target a different database. I've modified my SaveChanges and SaveChangesAsync function…
Josh
  • 2,422
  • 2
  • 27
  • 18
3
votes
1 answer

Audit.Net, - need correct auditing even when exception is thrown

When this method is executed in the Controller: [Route("deleteIncCloseOut")] [HttpDelete] [AuditApi] public bool deleteIncidentCloseOut(int ID) { try { using (ESSDataContext ctx = new ESSDataContext()) { …
Igavshne
  • 699
  • 7
  • 33
3
votes
1 answer

Is it possible with Audit.EntityFramework to ignore inserts on certain entities?

I want to use Audit.EntityFramework with EntityFramework Core but ignore inserts in audit logs only for some entities. I cannot find any info about that on the github documentation for Audit.EntityFramework. Maybe someone faced same problem and…
3
votes
1 answer

How to set Target object of AuditEvent using Audit.Net extension Audit.Mvc

I have to add auditing to a system that I didn't code, and which wasn't programmed with any thought to auditing. Then I came across Audit.Net, and what an awesome framework! I'm using the Audit.Mvc extension as well. Anyways, I want to add a…
Igavshne
  • 699
  • 7
  • 33
1
2 3
8 9