Nlog ${event-context:item=xxxx} not writing in logging database

后端 未结 3 2090
萌比男神i
萌比男神i 2021-01-24 05:11

I have a Nlog configuration that is basically this:

\">
  &         


        
3条回答
  •  旧时难觅i
    2021-01-24 05:21

    Thanks for the fix. This issue has evolved slightly since your original positing.

    After chasing down all the github patches (334, 331, 371) related to this problem and checking that they haven't been reversed, I've discovered that ${event-context:item=x} doesn't seem to work properly anymore but ${event-properties:item=x} does. To be fair they did mention that context is deprecated. So change your NLog.config to use event-properties is my advice.

    Oh and I'm on NLog v4.1.0 and NLog.Extended v4.0.0.1 in case this crops up in the future.

提交回复
热议问题