Hi,
I have issues writing to a CSV file while the log file is opened by a user.
All log events are not wriiten to the file, until the file is closed by the user, and then is continues to write correctly.
Do you know about any configuration that enables this?
This is how the relevant section in my config file looks like:
<nlog autoReload="true" throwExceptions="true" xmlns="
http://www.nlog-project.org/schemas/NLog.xsd"
internalLogFile="${basedir}/NLogInternalErrors.txt" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target concurrentWrites="true" concurrentWriteAttempts="5" concurrentWriteAttemptDelay="5" name="csv" xsi:type="File"
fileName="${basedir}/Log_${shortdate}.csv" keepFileOpen="false"
archiveFileName="${basedir}/Archive/Archive_Log_${shortdate}_{#}.txt"
archiveEvery="Minute" archiveNumbering="Sequence"
maxArchiveFiles="100" >
When I set the keepFileOpen attribute to "true", it worked, meaning it locked the file, and when I tried to opened it I got the notification that it's already opened by a user.
In this way is kept updating the file but in a lock mode.
Do anyone have an idea of how to make NLog write to a file while the log file is opened for edit by a user?
Thanks in advance!