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
1
vote
1 answer

Filter Requests based on Response Status Code Audit.Net

I want to filter requests based on ResponseCode i.e requests with 500, 400, 401 etc response status codes should not be logged with Audit.Net. I have used AuditMiddleware but it is not filtering 500, 400 and 401 requests responses. Code: …
1
vote
0 answers

Is it possible to use Audit.Net without managing Audit_{Entity}s separately?

Config: .Net 5 Audit.Net with Audit.EntityFramework.Identity.Core EntityFramework DataProvider Audit.Core.Configuration.Setup() .UseEntityFramework(x => x .AuditTypeNameMapper(typeName => "Audit_" + typeName) …
swarts97
  • 59
  • 6
1
vote
1 answer

How to achieve generic Audit.NET json data processing?

I am using Audit.Net library to log EntityFramework actions into a database (currently everything into one AuditEventLogs table, where the JsonData column stores the data in the following Json format: { "EventType":"MyDbContext:test_database", …
swarts97
  • 59
  • 6
1
vote
0 answers

Decrease Audit.Net time while creating audit entries

Current Scenario We have an endpoint and it has an entity and in that entity it has List of other entity. When we send request to it without Audit.Net configurations the response time can be 710ms to 723ms. But when we add Audit.Net, the response…
1
vote
1 answer

What is default behavior InsertEvent or InsertEventAsync

For data providers that allow asynchronous operations, is the standard asynchronous method used? If not, how do I deify this behavior?
1
vote
1 answer

Prevent Audit.Net from formatting BodyContent values as strings?

I'm getting familiar with audit.net, and finding that the serialization isn't working quite right. I'm wondering if I need to add more configuration. My current config is as follows: // Startup.cs public void ConfigureServices(IServiceCollection…
Ben Wong
  • 339
  • 1
  • 8
1
vote
1 answer

Insert audit.net data into database

I have created the following code which generates a JSON of the changes that have been made using Audit.net and Audit.EntityFramework.Core; AuditNet.Configuration.Setup() .UseEntityFramework(_ => _ …
1
vote
1 answer

Location header missing in response headers in Audit.Net

When using Audit.Net I'm including entire response to be audited such as response content, headers and IncludeHeaders too, below is my configuration: mvcOptions.AddAuditFilter(a => a .LogRequestIf(d => d.HttpContext.Request.Method !=…
JPReddy
  • 63,233
  • 16
  • 64
  • 93
1
vote
1 answer

How to track event in Audit.Net with SqlDataProvider

I'm trying to audit db actions using SqlDataProvider . Global.asax.cs Audit.Core.Configuration.DataProvider = new SqlDataProvider() { ConnectionString = "...", Schema = "dbo", TableName =…
1
vote
1 answer

Basic WebApi implementation with Audit.NET and C#: error EntityFrameworkCore.Internal.EnumerableExtensions

I'm just starting using Audit.NET. I download the template from dotnet new -i Audit.WebApi.Template dotnet new webapiaudit -E Unfortunately, the project doesn't work. When I post a value, I have an internal server error. The description is quite…
Enrico
  • 3,592
  • 6
  • 45
  • 102
1
vote
1 answer

Audit.NET auditing 2 different contexts to 2 different databases

I have an ASP.NET Core application with 2 contexts for 2 databases (context_1 and context_2). I want to audit both contexts ,using Audit.Net, to separate databases (context_audit_1 and context_audit_2)so I will have 4 databases in total. The problem…
Sarahbe
  • 123
  • 1
  • 16
1
vote
1 answer

Audit.Net not tracking new values

Trying to implement Audit.Net in a project using .Net Core and EF Core Sample Context is defined as [AuditDbContext(Mode = AuditOptionMode.OptOut, IncludeEntityObjects = true, AuditEventType = "{database}_{context}")] public class MyContext :…
JerseyDuke
  • 69
  • 6
1
vote
1 answer

AuditIgnore on some functions

On application first startup I have a seed function called. I am using audit.net to audit EF entities. Is there any way not to audit the seeded data on startup ?
Sarahbe
  • 123
  • 1
  • 16
1
vote
1 answer

Audit.NET EntityFramework

I am trying to replace our own Audit system with Audit.NET. I have checked the documentation for Audit.EntityFramework, https://github.com/thepirat000/Audit.NET/tree/master/src/Audit.EntityFramework, and it is not clear to me where the configuration…
tessierp
  • 506
  • 5
  • 8
1
vote
1 answer

Audit.NET and Asp Net Core Razor Pages

I am using razor pages in my ASP.NET Core application. I need to enable logging with Audit.NET library, it works fine with ASP.NET MVC controllers, but it doesn't work with Razor pages. Here is an example how I declare a PageModel class with Audit…
1 2 3
8 9