I’m using NLog as my logging provider. I’d like to set custom attributes, for example, “modulename”, and “userref”, so in my web.config I could specify these:
And, when logging, I could assign the custom attributes, and have them available for rendering in NLog. In this example, both the message, and the exception, have the attributes available.
customAttributes[“modulename”] = “Module A”;
customAttributes[“userref”] = “User A”;
logger.Error(“Some message”, customAttributes, ex);
Is the best approach for me to extend this somehow? Or, is there a way to provide custom attributes that I’m missing?