How can I write a logfile from a C# service so that it gets flushed to disk in a timely fashion?
Here\'s what I\'ve tried. In logging code, I opened a file like this:>
Per this answer, under .NET 4.0 it's enough to just call
file.Flush(true)
Messing around with the p/Invoke call is no longer required.