This will read the entire log file into memory, which isn't such a good idea. Sometimes these log files can get as big as ~2GB. I'm going to add some overall comments below about how to consider doing this without reading the entire file... because it will be a bit of work.