The only changes made are:
- Added a 'ConsoleApp' project to the NLog.netfx40 solution in the src folder that you should set as your Start Up project. This is just to apply the Buffer Wrapper Target through the NLog settings in the app.config file, and to write some log lines in the Main method.
- Inserted a new line at line 725 of src\Targets\FileTarget.cs inside the Write method. The line contains a Thread.Sleep to mimic a blocking call that can be expected in other targets e.g. MailTarget.
If you now run the start up Console App project the log does not get written. If you comment out the Thread.Sleep, the log will be written.
As mentioned, the reason I spotted this was because I am writing to a BufferTarget that wraps a MailTarget. When the BufferTarget flushes, sometimes the MailTarget will hang when connecting to the mail server, this therefore causes the Log not to be written.
Hope that's all clear!