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
3
votes
1 answer

Get username within startup.cs in Asp.net core

I'm using Asp.net Core Authorization and I need to get username within startup.cs but I got null. public void ConfigureServices(IServiceCollection services) { // some code here services.AddHttpContextAccessor(); …
3
votes
1 answer

Dynamic audit table creation via Migrations

Using .Net Core 2.1 and Audit.NET EF 12.1.10, I'm trying to add a migration that includes the audit tables but when invoking Add-Migration, no audit tables are generated in the migration. I assumed that using the "dynamic" audit will do this…
Los Morales
  • 2,061
  • 7
  • 26
  • 42
3
votes
2 answers

ASP.NET Core Entity changing history

I have many controllers like this: public class EntityController : Controller { private readonly IEntityRepository _entity; public EntityController(IEntityRepository entity) { _entity = entity; } [Authorize] …
2
votes
2 answers

Audit.NET Entity framework data adapter, object properties not logged

i setup Audit.net for my model and all works fine but nested properties are ignored and got 0 in corresponding log table fields model public class ElementoWorkflow : BaseObject { public override int Id { get; set; } …
gt.guybrush
  • 1,320
  • 3
  • 19
  • 48
2
votes
1 answer

Audit.Net - Find all audits of a given entity

I am using Audit.Net with Entity Framework Data Provider. I am using one database for the application data and a different database (and DbContext) for the audits. In the core configuration, I am seetting the the explicit mapper as in this…
Adam
  • 348
  • 2
  • 8
2
votes
0 answers

.NET Core Audit Returns same Old and New values while Database Update and store in JsonData while using Dapper

I am facing a problem while returning the Audit Data Old and New value are same. Here is the Code which I am using for Updating my Database. Please help to understand what is going wrong here. Please find the Code here using…
Seena N
  • 31
  • 3
2
votes
1 answer

Audi.EntityFramework does not generate log

I want to generate logs of multiple entities for just one table. At startup I'm configuring dbcontext this way Audit.Core.Configuration.Setup() .UseEntityFramework(_ => _ .AuditTypeMapper(t => typeof(AuditLog)) …
2
votes
2 answers

Audit.NET Adding UserName to AuditLog when logging EF but can't reach HttpContext

Context I am trying wireup Audit.Net in an MVC5 app with .Net Framework 4.8. Dataprovider: EntityFramework Output: Cosmos DI Provider: Autofac The Problem I have tried the following call backs to try and write the username to the…
vick
  • 81
  • 7
2
votes
1 answer

Audit.net ignoring Http Get methods with a global action filter

I'm using Audit.net for auditing all .net core Web API requests. I want to use global action filter to audit all the HTTP requests but don't want to Audit HTTP GET methods. While configuring AddAuditFilter I can conditionally log action by using…
JPReddy
  • 63,233
  • 16
  • 64
  • 93
2
votes
1 answer

How to log Update(IList) action as multiple audit records using Audit.net

I have to update bulk records in a table. I did it as following. BaseRepository.cs public IList Update(IList instance) where T : class { IList insertedItems = new List(); int totalCount = instance.Count; …
Mad
  • 41
  • 8
2
votes
1 answer

Audit.NET obtain database credentials dynamically

We are using Audit.NET library in our Asp.Net Core project to log user actions. Recently we have decided to use Hashicorp Vault to securely store and obtain secrets including database credentials. Vault engine automatically rotates database…
2
votes
1 answer

How to write an audit log entry per changed property with Audit.NET EntityFramework.Core

I'm trying to get the Audit:NET EntityFramework.Core extension to write an AuditLog entry per changed property. For this purpose I've overidden the EntityFrameworkDataProvider.InsertEvent with a custom DataProvider. The problem is, using…
mherberth
  • 23
  • 3
2
votes
1 answer

Issue while using Audit.Net.MongoDB

I am using Audit.Net package for auditing requirements for my application. https://github.com/thepirat000/Audit.NET/tree/master/src/Audit.NET.MongoDB#auditnetmongodb I am facing JSON Serialization exception, when I try to use the AuditScope.Create…
2
votes
1 answer

How to generate database table use by Audit.EntityFramework.Core

I have follow the instruction in below url of how to setup the Audit.net for aspnetcore and sql server as the datasource. https://github.com/thepirat000/Audit.NET/tree/master/src/Audit.EntityFramework however i am receiving an error as…
mokh223
  • 544
  • 3
  • 5
  • 14
2
votes
0 answers

Audit.net seems to hang when a dynamic proxy entity type is used as the target object

I've been trying to get Audit.Net to work for my MVC EF 6.2 project. I have everything set up and is able to save my audit logs into my sql server table. The issue that I have is for objects that are directly being returned from my db context, EF…
Ottarl
  • 47
  • 7
1
2
3
8 9