log and cache