Sulphy
Sulphy

Reputation: 776

NLog and the include file option

Ok, this has been doing my head in all day. In my UAT setup I have the following in my web.config

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance>
<include file="d:\logs\nlog.config"/>
</nlog>

This pulls in all my rules and targets and has been working fine. That was until I published to our prod server. Same setup but it fails to find the nlog.config file.

At first I thought it was NTFS permissions, but Nlog can write to the same folder location as where this config file resides. I used the internal logging to get an idea what was happening. Nlogs internal log just says that the file doesn't exist. I can't seem to identify why the same setup works in one system but not on another. I've added all relevant NTFS permissions (triple checked) and even went as far as granting 'everyone' read rights as a test, still no joy.

I'm guessing there's something going on within IIS that is stopping the app from reading outside of the root web folder on prod? Which would be odd given it can write to the same place.

Upvotes: 0

Views: 804

Answers (1)

Sulphy
Sulphy

Reputation: 776

It's ok, I was being a donut, well sort of. I created a text file and named it nlog.config not realising that .txt had been stuck on the end. Now the problem makes sense! It never clicked because the .txt was hidden and showing the name as nlog.config in explorer. :o)

Upvotes: 1

Related Questions