Microsoft Enterprise Logging Application Block - Reading Log File
Posted
by Or A
on Stack Overflow
See other posts from Stack Overflow
or by Or A
Published on 2009-12-29T22:48:35Z
Indexed on
2010/05/20
10:20 UTC
Read the original article
Hit count: 182
Hi,
I'm using MS log application block for logging my application event into a file called app-trace.log which located on the c:\temp folder.
I'm trying to find the best way to read this file at runtime and display it when the user asks for it. now i have 2 issues:
it seems that this kind of feature is not supported by the framework, hence i have to write this reader myself. am i missing something here? is there any better way of getting this data (w/o buffering it in the memory or saving it into another file).
if i'm taking the only alternative that left for me, and implementing the reader myself, when i'm tring to do:
System.IO.FileStream fs = new System.IO.FileStream(@"c:\temp\app-trace.log", FileMode.Open, FileAccess.Read);
i'm getting "File being used by another process c#", probably the file is locked by the application block. is there any way to access and read it anyhow?
Thank
© Stack Overflow or respective owner