in reply to Issue merging 2 log files.

Rather than merging in memory, open the two input files and keep the next line from each available. Write the next line from those two choices directly to your output file and replace it from the corresponding source file. Repeat until you don't have any more source lines available.

The cake is a lie.
The cake is a lie.
The cake is a lie.