I am using basic Parallel.Foreach loop on Random numbers to log number itself using log4net.
Here is my code to log 5000 messages on parallel threads
You are writing to the GlobalContext, I guess you need to write to the ThreadLogicalContext instead to get it working the way you want.