I have a script that has multiple threads running in parallel. These threads write to a Log4Net RollingFileAppender file. Reading this log is a quite confusing since all the thread logs are mixed up.
Im wondering what is a good way to write these logs, and what is the best way to read these files so reading the debugging information of a particular thread becomes easier.
I have a script that has multiple threads running in parallel. These threads write
Share
Update your config file to include the thread name in the log output. If you set the Threads name in code, that same name will be logged to your file. This is a simple example of including the thread name via the log4net config file <conversionPattern> tag:
UPDATE
I wrote a simple POC app to demonstrate this. http://codereport.net/logging-the-thread-name-with-log4net/