My app gets CFileException::sharingViolation when nxlog is running

View thread

phg98

Hi,

My app runs on Windows and it writes log to the file a.log. When I run NXLog to watch this file (to send log to the server), My app gets CFileException::sharingViolation trying to write log to a.log file. It does not happen always, but when the log is big sometimes it happens and my app can not write log to a.log file.

Searching the internet, I found 'You should open the file with CFile::shareDenyNone' to avoid this problem. So my questions is :

  1. Is NXLog opens the file with ' CFile::shareDenyNone'?
  2. How can I avoid this problem?

Here's my nxlog.conf 's input configuration.

<Input watchfile> Module im_file File 'C:\Log\a.log' Exec $Message = $raw_event; Exec if file_name() =~ /.\(.)/ $SourceName = $1; SavePos TRUE Recursive TRUE CloseWhenIdle TRUE </Input>

Any comment will be appreciated. Thanks

Harry