NLog is not writing in deployed app

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

NLog is not writing in deployed app

onefootswill
I have added NLog to my project and in the development environment, it works fine.

I created a Setup file to deploy my application. The NLog.config file did not show up as a dependency in the Setup project. So, I added it as a file and it is present in the same directory as the exe file and App.config when deployed.

It does not do any logging. I don't know why. Here is the config file:
<nabble_embed> <?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <variable name="day" value="${date:format=dd}" /> <variable name="month" value="${date:format=MM}" /> <variable name="year" value="${date:format=yyyy}" /> <variable name="verbose" value="${longdate} | ${level} | ${message} | ${exception:format=tostring,message,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method}}" /> <targets> <target name="logfile" xsi:type="File" fileName="${basedir}/Logs/${year}${month}${day}.log" layout="${verbose}" /> </targets> <rules> <logger name="*" minlevel="Error" writeTo="logfile" /> </rules> </nlog> </nabble_embed>

Any help would be appreciated.
Thanks