Skip to content

Instantly share code, notes, and snippets.

View eman41's full-sized avatar
👨‍💻

Eric P. eman41

👨‍💻
View GitHub Profile
@eman41
eman41 / gist:4fc5ed783d4c1d89c2ddb4476b6348a3
Created February 18, 2021 18:21 — forked from mikedavies-dev/gist:989dd86a1ace38a9ac58
A simple log file monitor class for .NET
/*
A simple log file monitor class for .NET
Uses a threaded timer to check for changes in the file, if the file length has changed then the unread
section of the file is read and parsed into lines before being passed back to the event handler.
Note, because the class uses the threaded timer callbacks on the event hander WILL be made form a
different thread, keep this in mind when using the class.
@eman41
eman41 / LogFileMonitor.cs
Created February 18, 2021 18:21 — forked from mikedavies-dev/gist:989dd86a1ace38a9ac58
A simple log file monitor class for .NET
/*
A simple log file monitor class for .NET
Uses a threaded timer to check for changes in the file, if the file length has changed then the unread
section of the file is read and parsed into lines before being passed back to the event handler.
Note, because the class uses the threaded timer callbacks on the event hander WILL be made form a
different thread, keep this in mind when using the class.