filePath under IIS

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

filePath under IIS

JasonBock
When I run my ASP.NET app locally (under IIS Express), my file does not go into the directory where the application is hosted. If I put in an absolute path into filePath, that works. But that's not desirable as that will change from developer machine to developer machine.

I'm thinking I could create a wrapper for the File target that will take the filePath value and map it to the directory that the v-dir maps to, but is there something in NLog that already does this?

Thanks,
Jason
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: filePath under IIS

Jason LaFlair
Administrator
Look at the Layout Render ${basedir} - if you want it in the bin directory just use ${basedir}/bin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: filePath under IIS

JasonBock
Perfect, that works like a charm - thanks!
Loading...