Absolute path in nlog.config
kgothatsotlaka opened this issue · 2 comments
kgothatsotlaka commented
Hi, I'd like to know, since in the example you used absolute paths, will this approach not give us a problem during production?
If so, how does one go about using relative paths ?
Thanks
MarinkoSpasojevic commented
Hello. You have two solutions for this. In a production environment, you will have nlog.config file deployed as well, so you can change absolute locations to the right ones.
Or you can change these absolute paths with relative ones:
<target name="logfile" xsi:type="File" fileName="..\logs\${shortdate}_logfile.txt" layout="${longdate} ${level:uppercase=true} ${message}"/> </targets>
kgothatsotlaka commented
Thank you! I will try using the absolute path method for now