Add: Implement log file writing