I have my nLog layout like below
fileTarget.Layout = "${date} ${message}";
In My code, i am logging like following
logger.Info("ORDER UPDATE",order.Name,order.Instrument,order.OrderState);
However it only logs the first string
for eg.
11/22/2012 22:37:16 ORDER UPDATE
11/22/2012 22:37:16 ORDER UPDATE
11/22/2012 22:37:16 ORDER UPDATE
11/22/2012 22:37:16 ORDER UPDATE
I am pretty sure that i am missing something in my layout but cannot figure out how to fix it. Can someone point out my error?
To save all your strings you should concatenate them first. As I see, your logger recognizes only first one, so you should add other strings you need to make them one string since you are actually logging one string, not several. Or update your logger to recognize numerous strings, I mean something like this:
fileTarget.Layout = "${date} ${message1} ${message2} ${message3} ${message4}";