Performs the value logging and file handling