Log caching for errors