A web app and its background worker each write their own file, and the bug sits somewhere between them. Reading two files side by side gets old quickly.
When every line starts with a sortable timestamp, such as 2026-11-30T14:05:09, merge them:
sort -m app.log worker.log | less
-m merges files that are already in order, which log files usually are. It does not re-sort them, so it is quick even on large files.
The trouble is that you lose track of which file a line came from. Tag each line with its source, after the timestamp field:
sort -m -k1,1 <(sed 's/ / app /' app.log) <(sed 's/ / worker /' worker.log) | less
The sed inserts a label at the first space, and -k1,1 merges on the timestamp alone. The <( ) form needs bash or zsh.
I find this the cheapest way to see that a request arrived, the worker picked it up and the error came two seconds later.
It only works with timestamps that sort as text. Month names like Nov 3 in classic syslog format do not. Both files should also use the same time zone, or the merged order is wrong while looking perfectly reasonable. Lines without a timestamp, like stack traces, can end up away from their parent line.
Further reading: sort invocation