Logarithmic corrections to $\mathbf{a^2}$ scaling in lattice QCD with Wilson and Ginsparg-Wilson quarks