Howto process log file from where it left

Hi all

I am doing some matching apache access log processing.Now i want a some way that i can start log search/process from where it left.Can any one give me ideads.

Only and idea: Each time, write to a file the last linenumber processed.
Next time read that number into a variable and begin processing at that line plus 1.