move log record logic into file utility