Logging Asynchronous/Parallel functionality?

I’ve been using the .NET Concurrency library for a while now with specialized logic to handle writing to log files in a manner that is consistent and understandable for a human to parse.

Just recently, I’ve started replacing legacy code with the TAP (Async/Await) as we’ve finally transitioned above .NET 4.0 as a standard.

After review, I have a lot of interesting ideas to asynchronously perform tasks that were previously synchronous, but it introduces a lot of questions as to how to maintain a good “log state” so that a human who is reviewing can follow.

My only idea so far is that log statements for any given “section” of work are queued as an object, and when finished, then fed to the logger, which would write them in order (as a block) to the log file.

I’m looking for other advice and/or ideas on the subject.

What do you do?

submitted by /u/Shidell
[link] [comments]

Leave a Reply