Skip to content
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

LogFactory Flush without threads and introduce FlushAsync #5453

Open
snakefoot opened this issue Dec 31, 2023 · 1 comment
Open

LogFactory Flush without threads and introduce FlushAsync #5453

snakefoot opened this issue Dec 31, 2023 · 1 comment
Labels
Milestone

Comments

@snakefoot
Copy link
Contributor

snakefoot commented Dec 31, 2023

Make LogFactory.Flush() synchrone without spinning up threads. Instead provide Task FlushAsync() if wanting parallel target-flush capability.

Allow NLog to work out-of-the-box on platforms with limited thread-support. See also #4266

@snakefoot snakefoot added this to the 6.0 milestone Dec 31, 2023
@snakefoot
Copy link
Contributor Author

snakefoot commented Feb 24, 2024

Could be interesting to implement IAsyncDisposable.DisposeAsync so one could do this without explicit call to LogFactory.Shutdown():

await using var nlogFactory = NLog.LogManager.Setup().LogFactory;

Then one could avoid try-finally and still get parallel flushing. Sadly enough this requires NET6 and not supported by NET48 / NetStandard2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant