Ten thousand lines that differ only by an ID or a port number look like ten thousand problems. Usually there are a handful.
Replace every number with a placeholder, then count identical lines:
sed -E 's/[0-9]+/N/g' app.log | sort | uniq -c | sort -rn | head -n 15
The top of the output is the most frequent message shape with its count. A line like err id N from N.N.N.N now stands for all its variations.
Timestamps at the start become N too, which is what you want here. If each line begins with a hostname or a long random token, cut that part first:
cut -d' ' -f4- app.log | sed -E 's/[0-9]+/N/g' | sort | uniq -c | sort -rn | head
Adjust the field number to your format. For hex request IDs, add a second expression:
sed -E 's/[0-9a-f]{8,}/ID/g; s/[0-9]+/N/g' app.log | sort | uniq -c | sort -rn | head
I run this first on a log I have never seen. It shows what is normal noise there, and the rare lines at the bottom (tail instead of head) are often the interesting ones.
Masking throws information away. Two errors that differ only in a status code, say 404 and 500, merge into one line. Look at some original lines before you draw conclusions from a count.
Further reading: sed manual, uniq invocation