At this point, I have to ask the question...
WHY are you writing this information out to a file? Why not just write it to a table where you can create reporting queries, etc, etc, from the error data?
--Jeff Moden
Change is inevitable... Change for the better is not.