Audit MongoDb 22 no working #640
Replies: 4 comments 5 replies
-
What are you trying to audit? How are you generating the audit events? What happens if you manually create and save an audit event after your MongoDB configuration? Do you get an exception? For exanple: Audit.Core.Configuration.Setup()
.UseMongoDB(config => config
.ConnectionString("mongodb://localhost:27017")
.Database("Audit")
.Collection("Event"));
AuditScope.Log("Event Type", new { ExtraField = "extra value" }); |
Beta Was this translation helpful? Give feedback.
-
I'll keep this open as I believe we have the opportunity to develop a MongoDB.Driver interaction extension using command events. I will delve into it further and potentially initiate work on the new extension |
Beta Was this translation helpful? Give feedback.
-
Nota that a new library is provided Audit.MongoClient to support auditing a MongoClient instance. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use Audit.NET.MongoDB, but it's not generating the log.
I've already tried it in the same DB as my application, in a separate DB called Audit and Collection Event, but regardless of the configuration it doesn't work.
I tested these 2 examples
Audit.Core.Configuration.DataProvider = new Audit.MongoDB.Providers.MongoDataProvider()
{
ConnectionString = "mongodb://localhost:27017",
Database = "Audit",
Collection = "Event"
};
and
Audit.Core.Configuration.Setup()
.UseMongoDB(config => config
.ConnectionString("mongodb://localhost:27017")
.Database("Audit")
.Collection("Event"));
My item insert works, but the log is not generated.
I'm using .net 6 and version 22 of the package and I added the examples to the application startup.
Would you help me?
Beta Was this translation helpful? Give feedback.
All reactions