Decode log file

Refactor into reading the logfile always the same way