Add logging to Writer, lock where it should have been locking already