I have the following scenario: 1. .NET UI side uses Logging App Block to write to a flat file 2. Unmanaged Windows Service uses a proprietary logger to write to the same file as 1.
Question: Is there a way to enable FlatFile TraceListener to close it's file handle once the entry is logged so that the Windows Service could also write to the file?
Thanks!
Update: I included Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Writer.Dispose(); and this closes the stream, so this would do the trick -- just curious if there is another way to do this.
Update2: Final Notes
P&P proposes to write to a single MSMQ from multiple applications. This way you won't need to call Dispose(), etc.