Add a lock on the log data structure.