|
Hello,
I created a NLog logger as follows:
NLog.Logger logger = NLog.LogManager.GetLogger("My Logger");
Where the follows works fine:
NLog.LogEventInfo info = new NLog.LogEventInfo(NLog.LogLevel.Info, "My Logger", "My Message");
info.Properties["data"] = "My Data";
logger.Log(info);
When having the following in NLog.config: <parameter name="@Data" layout="${event-context:item=data}" />
But then I tried the following:
logger.Info("My Message", new { data = "My Data" });
But I am not able to change my NLog.config to make this work.
How can I pass arguments this way?
Please, could someone help me?
Thank You,
Miguel
|