lock file and new logging