open log file as a raw byte stream (fixes core#23989)
The log file can be read partially while some emoji is being written, causing a UnicodeDecodeError. It did not make sense to decode the file anyway, as the file content is not being used. We read the file only to count the log lines.
This is a backport of core#24039