Hi,
My Java needs to check a log file to see if things are correct. If there
is a word, "successfully", then it is correct. I hate to read in each
line, parse it into tokens, and check each token. Is there a better way
to do it?
Thank you.
Danno - 26 Jan 2007 16:49 GMT
> Hi,
>
[quoted text clipped - 4 lines]
>
> Thank you.
If you use log4j you can create your own intercepting appender that
alerts you when the "successfully" message is placed into the log file.
Alex Hunsley - 27 Jan 2007 02:49 GMT
> Hi,
>
> My Java needs to check a log file to see if things are correct. If there
> is a word, "successfully", then it is correct. I hate to read in each
> line, parse it into tokens, and check each token. Is there a better way
> to do it?
Break into tokens? How about using String.indexOf() instead?
> Thank you.
Daniel Pitts - 27 Jan 2007 05:33 GMT
> Hi,
>
[quoted text clipped - 4 lines]
>
> Thank you.
How about using indexOf or regex? Better yet, is there any way the
log-writting process can indicate success/failure through another more
direct means? Such as return code?