I have to monitor a large log file during the day with C#. The size goes up to 200-300 MB for a day.
What is the most efficient way to analyze it?
The file is locked by the producing program. Preferably I would either have a read which realises that lines have been added or would read backwards.
views:
183answers:
3
A:
Change log rotation to a smaller value and then process the rotated logs - or - Process the whole log file the first time and remember the fileoffset / line for the next checking interval.
DCA
2010-07-16 09:58:00
+2
A:
A combination of MemoryMappedFile
and FileSystemWatcher
should do the trick.
Oliver
2010-07-16 10:23:59