The best known error term (f(x) in the original question) is in
E.A. Vasil’kovskaja, Mertens’ formula for an arithmetic progression, Taškent. Gos. Univ. Nauˇcn. Trudy, VoprosyMat. 548 (1977) 14–17, 139–140
See also the introduction of my paper with Zaccagnini on j.number theory, 127 (2007), 37–46, https://doi.org/10.1016/j.jnt.2006.12.015