-
Notifications
You must be signed in to change notification settings - Fork 42
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
Option to use synchronous logging #59
Comments
Hi! I think you can get the behavior you want by disposing your Best regards, |
I'm using System.CommandLine package and their ServiceProvider is internal and does not implement I think serilog-extensions-logging-file shouldn't assume we're using
I think that's fine for short-live applications such as CLI. I believe making async is slower for CLI to be honest. Which instance from Serilog do I need to dispose in order to flush the logs before the application exits? |
Hi! This might be valuable feedback for the System.CommandLine folks; though, my guess is that they'll already have some APIs available for switching IoC containers etc. It's pretty common for services to require disposal - plugging in a regular container, or using the generic host via If you were to use Serilog directly instead, then disposing the Serilog It sounds like this is a bit of a pain at present, but I don't think it's something within the scope of what this simplified package should address; disposing loggers to flush them is extremely common (as is disposal of all kinds of services). Hope this helps, |
On short-lived applications such as command line interfaces, using
async
is not optional and logs are not written.Can we add an option to the
AddFile
to use synchronous log?The text was updated successfully, but these errors were encountered: