This project is read-only.
3
Vote

Data loss when applying concurrentWrites and keepFileOpen

description

Hi,

Consider following scenario.
  1. I am starting 5 applications logging 30,000 messages each.
  2. I am expecting 1,50,000 messages at the end in the log files. Applications are sharing the same log file destination.
  3. I am leveraging concurrentWrites = true and keepFileOpen = true. Now the problem is, we are not getting 1,50,000 messages logged at the end.
We have around 1,30,000 messages and other messages are lost. I am closing all applications once all logs are written to the file and I am also calling LogManager.Flush(); at the end.

Are we missing any configuration here? Attached is my configuration.
Any help in this direction would be great!

Thanks

file attachments

comments

johnnyjob wrote Dec 4, 2013 at 11:23 AM

And try to remove your log file manually - you'll see new log messages are not logged anymore, until you restart a process. I reproduced it in NLog 2.0 and in 2.1 in a test application, but feel too lazy to post a new issue here because other issues I posted haven't been addressed for months.