use the line length when logging the line

Explicitly check the line length before logging, since the line could have partial data. This can happen if we receive a very large stat that gets truncated and therefore is not null terminated.