NLog not working in release mode

前端 未结 6 1160
孤城傲影
孤城傲影 2021-02-19 09:35

I am using NLog to log the exceptions in my asp.net mvc (C#) application.

NLog is not working in release mode. The same is working when running in debug mode.

Wh

6条回答
  •  萌比男神i
    2021-02-19 09:58

    Assuming you've configured NLog in the right way, like the other answers suggest, Try one of these

    1. Write Permission for your Server

      If you are using IIS, give WRITE permission for user IIS_USRS for your log folder.

    2. Constructor

      public LoggerService() {
          _logger = NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
      }
      

      The path for nlog.config could be different for you. Mine was on the same folder

提交回复
热议问题