We consider the two-dimensional randomly site diluted Ising model and the random-bond +-J Ising model (also called Edwards-Anderson model), and study their critical behavior at the paramagnetic-ferromagnetic transition. The critical behavior of thermodynamic quantities can be derived from a set of renormalization-group equations, in which disorder is a marginally irrelevant perturbation at the two-dimensional Ising fixed point. We discuss their solutions, focusing in particular on the universality of the logarithmic corrections arising from the presence of disorder. Then, we present a finite-size scaling analysis of high-statistics Monte Carlo simulations. The numerical results confirm the renormalization-group predictions, and in particular the universality of the logarithmic corrections to the Ising behavior due to quenched dilution.