Closed ckadluba closed 2 months ago
@cancakar35 the tests work now and I could remove the null checks.
But when I tried to test the code from the PR with the program included in samples\WorkerServiceDemo there was a problem. This little sample tries to write to a local DB using a batched and an audit sink. The table of the audit sink contained log entries but the one of the batched sink did not conain anything.
Were you able to successfully log using a batched sink with the update to Serilog 4?
I tested with appconfigdemo and a new asp.net app, didn't try worker service demo. Are there any selflog or exception for worker service?
I just tried with worker service demo and its working. LogEvents:
LogEventsAudit:
Thank you. Maybe it was something on my side. I'll try to find that out.
Okay now. Retried this on a different machine and now WorkerServiceDemo produced logs with batched and audit sink as it should. The PR can be merged.
Fork of original PR #545 from @cancakar35 but with fixed unit tests (see individual commits).
Original PR Text:
Related issiue: https://github.com/serilog-mssql/serilog-sinks-mssqlserver/issues/543#issue-2347936892
Update Serilog v3.1.1 to 4.0.0 https://github.com/serilog/serilog/releases/tag/v4.0.0 Update Microsoft.Data.SqlClient to 5.2.1 Remove dependency Serilog.Sinks.PeriodicBatching PerioadingBatching moved to BatchingSink in serilog core. https://github.com/serilog/serilog/pull/2055