ChangemakerStudios / serilog-sinks-mongodb

A sink for Serilog that writes events to MongoDB
Apache License 2.0
92 stars 53 forks source link

sink has quit working with no errors reported #57

Closed eric10k93 closed 3 years ago

eric10k93 commented 3 years ago

I'm running a MongoDB 4.0.9 Community Server.

I've been using Serilog with MongoDb Sink for months with no issues logging to this database under a collection titled Logging.

With seemingly no major changes, other than nuget package updates from time to time, this sink has quit working once I've put it into production. Oddly, the sink is working fine when I run it from my visual studio development environment.

I have confirmed that I've tested the identical connection string on both my development and production machine. It looks like this: mongodb://[user]:[password]@[host]:27017/Logging?authSource=admin

I've enabled self log in Serilog with this line: Serilog.Debugging.SelfLog.Enable(msg => File.AppendAllText(selfLogPath, msg));

This has successfully output a warning that I fixed, but nothing else.

Both machines have port 27017 open and I've confirmed I can access the MongoDb database using MongoDb Compass and the above connection string. This works on both machines.

Is there any additional debugging I could perform as to why the production machine would not be logging data to MongoDb?

The code is running fine on the production machine, as data is flowing to-from a MySql database connection within the app. Also, I have File and EventLog sinks successfully running... but the MongoDb sink doesn't work.

This is a .NET Core 3.1 Windows Worker Service application.

Jaben commented 3 years ago

Please try the latest v4.1 release.