Click here to Skip to main content
15,879,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a C# WPF application that I am writing that uses multithreading. What is the recommended method for logging errors? Do you have each thread report errors back to the main form for processing? Or have each thread log the errors to the DB or file itself? I am just looking for a little insight and couldn't find much on the subject elsewhere.

Thanks,
Scott
Posted
Updated 24-Aug-10 8:28am
v2

I would just log it in the application log (part of Windows). You can identify the thread if you take steps to provide identification functionality in the thread itself so that the thread can identify itself when it makes the log entry.
 
Share this answer
 
If you like log file you can create one stream and protect it with mutex. At least that is the way I do it under Linux.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900