How do I configure NLog to write to a database?

前端 未结 4 1299
走了就别回头了
走了就别回头了 2020-12-24 12:21

I\'m trying to get NLog to write to a database, however with my current code it throws an exception when I attempt to debug, the exception is: The type initializer for \'Not

4条回答
  •  一向
    一向 (楼主)
    2020-12-24 13:20

    You seem to be missing the parameters that are to be inserted.

    See the examples at http://justinpdavis.blogspot.com/2010/04/logging-to-database-with-nlog.html

    The nLog web page doesn't make it very clear that these are required, but if you squint your eyes and read https://github.com/nlog/NLog/wiki/Database-target you should find that they are required.

提交回复
热议问题