Save and restore log