I want to write a Java program that reads from the logfile while it is being generated. What I understand from the logfile is, records of website traffic are added to the logfile as the website receives hits..
The website in question doe not receive any hits after end of the day.
I have written a program that analyses the logs at the end of the day i.e. when all the transacations are over and there are no new additions to the file, the program will take that file and process the data.
Now I want to modify it to make it real time.
i.e. instead of processing the logfile at the end of the day, I want my program to take a line from the log file as soon as it is added to it, process it, wait till next line is available, grab it as soon as it becomes available and so on till we reach the end of the day.
I have never done anything so complicated before, have been searching the net for quite a few days now but could not find any idea suitable to my needs.
I will be really grateful if I get any help in accomplishing this.
Thanks in advance.
Looking forward for inputs
The website in question doe not receive any hits after end of the day.
I have written a program that analyses the logs at the end of the day i.e. when all the transacations are over and there are no new additions to the file, the program will take that file and process the data.
Now I want to modify it to make it real time.
i.e. instead of processing the logfile at the end of the day, I want my program to take a line from the log file as soon as it is added to it, process it, wait till next line is available, grab it as soon as it becomes available and so on till we reach the end of the day.
I have never done anything so complicated before, have been searching the net for quite a few days now but could not find any idea suitable to my needs.
I will be really grateful if I get any help in accomplishing this.
Thanks in advance.
Looking forward for inputs