1

I have an application using NLog for logging. My configuration is stored in NLog.config file, but I need to provide option to change it for the user. I know how to change Logger configuration, but is it possible to save such changed configuration back to NLog.config file programmatically so it stays changed also after application stopped?

Thanks a lot! Marek

Ezekiell
  • 19
  • 6

2 Answers2

-1

You can follow the following link which gives a details about Configuration API which may help you.

nitesh.kodle123
  • 1,041
  • 4
  • 11
  • 23
-1

I had more or else similar issue. I needed to edit the nlog config file. since i was using net2.0 , I was not able to use linq to edit the nlog config file . but edited the file using xdocument. hope the link below helps. how to edit the nlog config file programmatically

Community
  • 1
  • 1
Nisha
  • 1,783
  • 4
  • 18
  • 34