Let $X$ be a smooth variety over a field $k$ of characteristic $p>0$, and let $\mathcal{E}$ be an overconvergent isocrystal on $X$. We establish a criterion for the existence of a ‘canonical logarithmic extension’ of $\mathcal{E}$ to a smooth compactification $\overline{X}$ of $X$ whose complement is a strict normal crossings divisor. We also obtain some related results, including a form of Zariski–Nagata purity for isocrystals.