This article examines the value distribution of for almost every α where is ranging over a long interval and f is a 1-periodic function with discontinuities or logarithmic singularities at rational numbers. We show that for N in a set of positive upper density, the order of is of Khintchine-type, unless the logarithmic singularity is symmetric. Additionally, we show the asymptotic sharpness of the Denjoy–Koksma inequality for such f, with applications in the theory of numerical integration. Our method also leads to a generalized form of the classical Borel–Bernstein Theorem that allows very general modularity conditions.