  Periodic patterns of logarithmic oscillations can arise in primordial
curvature perturbation spectra and in the associated gravitational-wave
background via different mechanisms. We show that, in the presence of log
oscillations, the spectral shape of the stochastic background has a unique
parametrization independent of its physical origin. We also show that this
log-periodic modulation can be generated in any scenario beyond Einstein
gravity endowed with an approximate discrete scale invariance, a symmetry
typical of deterministic fractal spacetimes that could emerge in quantum
gravity under certain conditions. We discuss how a log-oscillatory spectral
shape arises from concrete inflationary models beyond Einstein gravity and the
prospects for detection in Einstein Telescope and other next-generation
gravitational-wave observatories. We find that these instruments will be
sensitive to log-periodic features if the detection is made with a high
signal-to-noise ratio (SNR) and that the error scales as $1/{\rm SNR}$.
