String formatting error in NLogStrategy

Jul 14, 2010 at 8:22 PM

Note that I have not actually used Clog, but I was browsing the source for the NLogStrategy and saw what appears to be an error in the NLogStrategy when log messages are being formatted.  There are a couple of places where there is a line like this:

			data.Message = string.Format("{0}\nMachineName:{1} - ThreadName:(2) - UserName:(3)", logEntry.Message, logEntry.MachineName, logEntry.ThreadName,
			                             logEntry.UserName);


Note the ThreadName and UserName parameters.  the argument placeholder is enclosed in parentheses rather than braces.  If you execute a line like this with values like "aaa", "bbb", "ccc", "ddd", you will get a string like this:

aaa

MachineName:bbb - ThreadName:(2) - UserName:(3)

rather than this:

aaa

MachineName:bbb - ThreadName:ccc - UserName:ddd

Coordinator
Jul 14, 2010 at 9:32 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.