i created dictionary test data , wanted log logeventinfo. however, wrote desk name on console instead of correct information.
public void logdebugwithadditionalfields(string logmessage, idictionary<string, string> data) { logeventinfo loginfo = new logeventinfo(); loginfo.level = loglevel.debug; foreach (var dataitem in data) { loginfo.properties.add(dataitem.key, dataitem.value); } var logger = getloggerfullname(); logger.log(loginfo); } public logger getloggerfullname() { return logmanager.getlogger(gettype().fullname); } thanks help.
i forgot set correct layout. should include ${event-properties:item=string} in layout.
see here.
Comments
Post a Comment