469,106 Members | 2,327 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,106 developers. It's quick & easy.

Real Time Monitoring of a live log file in VB

This seems to be a difficult concept, I am having a heck of a time finding
information on techniques for simply having a VB app essentially tail and
parse what it finds.

The parsing I can handle, and the actions based on the parsing I can handle,
but the simple piece of the puzzle to gather the info as it arrives in the
log file is eluding me.

The scenario is this. I have a tool that will send its updates every so
often to a web server. The source for its information will be log files
created by another tool that is running.

I really dont want to read in the whole log filel every update, there should
be a way to have the app monitor the file and read in line by line every new
addition as it arrives.

Am I making this way too difficult or is there a way to do this? I have
seen other applications do this, but it seems to be vbvoodoo.

Any help or pointers greatly appreciated.

DougB.

Jul 17 '05 #1
2 6077
way too difficult. There is no facility to only access those last read lines
as to VB the file is a single entity. You could try to store/remember the
byte-offset of the last read, and use that as the starting point for the
next, but one way or another you will be dealing with the entire file -
unless you nuke the file once processed and rebuild a new file containing
the data you've read - IOW a file you maintain based on the data you've
already processed. This gives you the final log as history plus restricts
the source file to new data.

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"USENETSERVER" <ye**@right.com> wrote in message
news:6Z*****************@fe52.usenetserver.com...
: This seems to be a difficult concept, I am having a heck of a time finding
: information on techniques for simply having a VB app essentially tail and
: parse what it finds.
:
: The parsing I can handle, and the actions based on the parsing I can
handle,
: but the simple piece of the puzzle to gather the info as it arrives in the
: log file is eluding me.
:
: The scenario is this. I have a tool that will send its updates every so
: often to a web server. The source for its information will be log files
: created by another tool that is running.
:
: I really dont want to read in the whole log filel every update, there
should
: be a way to have the app monitor the file and read in line by line every
new
: addition as it arrives.
:
: Am I making this way too difficult or is there a way to do this? I have
: seen other applications do this, but it seems to be vbvoodoo.
:
: Any help or pointers greatly appreciated.
:
: DougB.
:
:
:

Jul 17 '05 #2
Thanks for the answer, I asked the writer of an App that I thought had this
knocked and thats pretty much what he is doing. He uses a seek and tracks
the amount read so far, appending to that value as he goes unding hitting
the end of the file, then a timer kicks in and starts it all over again
going to the last read spot in the file and using that as the startting
point.

I thought there was a more direct route given the speed I have seen this and
others work, but there isn't I guess.

Thanks for the response
Doug B.
"Randy Birch" <rg************@mvps.org> wrote in message
news:pV***************@news04.bloor.is.net.cable.r ogers.com...
way too difficult. There is no facility to only access those last read lines as to VB the file is a single entity. You could try to store/remember the
byte-offset of the last read, and use that as the starting point for the
next, but one way or another you will be dealing with the entire file -
unless you nuke the file once processed and rebuild a new file containing
the data you've read - IOW a file you maintain based on the data you've
already processed. This gives you the final log as history plus restricts
the source file to new data.

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"USENETSERVER" <ye**@right.com> wrote in message
news:6Z*****************@fe52.usenetserver.com...
: This seems to be a difficult concept, I am having a heck of a time finding : information on techniques for simply having a VB app essentially tail and : parse what it finds.
:
: The parsing I can handle, and the actions based on the parsing I can
handle,
: but the simple piece of the puzzle to gather the info as it arrives in the : log file is eluding me.
:
: The scenario is this. I have a tool that will send its updates every so
: often to a web server. The source for its information will be log files
: created by another tool that is running.
:
: I really dont want to read in the whole log filel every update, there
should
: be a way to have the app monitor the file and read in line by line every
new
: addition as it arrives.
:
: Am I making this way too difficult or is there a way to do this? I have
: seen other applications do this, but it seems to be vbvoodoo.
:
: Any help or pointers greatly appreciated.
:
: DougB.
:
:
:


Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by | last post: by
1 post views Thread by Evan Smith | last post: by
4 posts views Thread by Bob | last post: by
30 posts views Thread by Raymond Hettinger | last post: by
9 posts views Thread by Justin Rich | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.