open the log files and the output file. read first line of each log file. write oldest line to output file and read next line from corresponding input file. repeat.