Improved log file formatting