-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update serilog to 4 and move batching to Serilog core (fixed tests) #557
Conversation
Update serilog v3.1.1 to 4.0.0 Update Microsoft.Data.SqlClient to 5.2.1 PerioadingBatching moved to batching in serilog core.
* Removed null checks in config extensions if sink factory returns null before calling Sink() method from Serilog's LoggerSinkConfiguration or LoggerAuditSinkConfiguration. The truth is that our sink factory may not return null. If it does in production, we should let the exception happen. It happened in the tests because of a missing setup on two mocks. * Added missing setups in tests.
Bumped major version after Serilog update from 3 to 4.
@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? |
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: #543 (comment)
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. serilog/serilog#2055