Adding properties to log message in NLog in .net core
I am using NLog for logging messages in .net core. I have added NLog in StartUp.cs as follows: loggerFactory.AddNLog(); For logging to file, I am using following method: logger.LogInformation("Message"); I want to add custom NLog event properties to my message. But LogInformation() is not allowing me to pass that. How can I do that? truemedia If you want custom layout properties (NLog calls them layout renderers) you can use the EventProperties Layout Renderer . You can simply do this in your code: var logger = LogManager.GetCurrentClassLogger(); var eventInfo = new LogEventInfo(LogLevel.Info,