FileShare in Nlog?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FileShare in Nlog?

Mike Curtis
I need to read the open file for DataGridView (snapshot) but I seem to be stopped from doing so. Can I set the file sharing in NLog?

Mike
Reply | Threaded
Open this post in threaded view
|

Re: FileShare in Nlog?

Jarek Kowalski
Administrator
keepFileOpen="false"

Setting this option will cause NLog to open/close file on each write therefore keeping it available for other processes. this This option should be used unless you're doing some huge amounts of logging.

If you set keepFileOpen to true, you should still be able to open the file for reading. Just make sure that you use FileAccess.Read instead of FileAccess.ReadWrite.
NLog Blog