Some lame code from when I used to work at SI used for splitting up log files generated by Apache. Archived here for permanency.