© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
16 replies
Nacho Man Randy Cabbage

Proper way to constantly log to file

I am working on an app that will need a lot of logging. It's a completely offline system and the user wants all the logs to a file.

What is the best way to handle this so that:
1. All the logs are written in the order that they are called
2. It won't freeze the app waiting for any of the writing to complete

At first I tried just making every log call a fire and forget task, but I noticed some logs would be out of order.

There can be hundreds of log calls every few seconds so I can't make it synchronous because it freezes the UI (WPF if that matters). Any tips or suggestions would be great.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Proper way to download a file in .NET MAUI?
C#CC# / help
3y ago
Proper way to deploy application?
C#CC# / help
14mo ago
Proper way to access Navigational Properties
C#CC# / help
3y ago
JSON deserialization (proper way?)
C#CC# / help
3y ago