def _log_entries_to_log4j(entries):
    """Convert log entries from a single log file to log4j format, tracking
    line number.

    See :py:meth:`mrjob.logs.log4j._parse_hadoop_log4j_records`
    for format.
    """
    line_num = 0
    for entry in entries:
        message = entry.payload.get('message') or ''
        num_lines = len(message.split('\n'))
        yield dict(caller_location='', level=entry.severity or '', logger=
            entry.payload.get('class') or '', message=message, num_lines=
            num_lines, start_line=line_num, thread='', timestamp=entry.
            timestamp or '')
        line_num += num_lines
