update and clear log