Fix order of checks which logging statistics hit
Merge pull request #2264 from vanilla/hotfix/statistics-check

Fixes order of checks when logging statistics hit.