It's fairly classical that for $D>1$ and $(D,l)=1$ one has
$$\sum\_{\stackrel{p\leq x}{p\equiv l\; (mod \; D)}}\frac{\log p}{p} = \frac{\log x}{\phi(D)} + \textrm{O}(1)$$
where if I understand correctly the dependence on $D$ in the $\textrm{O(1)}$ is captured by something like
$$\frac{1}{\phi(D)}\sum\_{\textrm{non-principal} \; \chi}\frac{-L'(1,\chi)}{L(1,\chi)}$$
which is $\ll\_{\epsilon}D^{\epsilon}$ for any $\epsilon>0$. If this is correct, suppose I am interested in the sum
$$\sum\_{\stackrel{p\leq x}{\left(\frac{-D}{p}\right)=1}}\frac{\log p}{p}$$
where $\left(\frac{-D}{p}\right)$ is the Legendre symbol. There are $\phi(D)/2$ residue classes mod $D$ that $p$ can lie in, and so then this is just my previous sum $\phi(D)/2$ times, and I get that it's $1/2 \log x +\textrm{O}(1)$, where the dependence on $D$ in $\textrm{O}(1)$ is now something like $\textrm{O}(D^{1+\epsilon})$. Is this the best one can do? I was hoping I could get it to be $\textrm{O}(D^{\epsilon})$ but if that's not even correct perhaps I should stop trying.



Sum of log p/p for p equivalent to l mod D
You're right that your proposed method for estimating the new sum, while correct, gives a worse error bound than we can obtain otherwise. Rather than quoting the classical result itself, I suggest going back to the proof of that classical result and modifying it to address the new sum.


Somewhat more precisely: the Legendre symbol $\big( \frac{-D}p \big)$, or rather its multiplicative generalization the Jacobi symbol $\big( \frac{-D}n \big)$, is a Dirichlet character (mod $D$)—call it $\chi\_1(n)$. The sum you are interested in is just
$$
\sum\_{p\le x} \frac{\log p}p \bigg( \frac{1+\chi\_1(p)}2 \bigg).
$$
(Not exactly, since this expression counts primes dividing $D$ with weight $1/2$, but that's easily dealt with.) Therefore you're left with needing to understand $\sum\_{p\le x} (\log p)/p$ (no problem) and $\sum\_{p\le x} (\chi\_1(p)\log p)/p$. The latter sum is going to be $O(1)$ in the same way that the error term in the classical problem is $O(1)$; it is going to be related to $-L'(1,\chi\_1)/L(1,\chi\_1)$. So in fact you don't have all the different $-L'(1,\chi)/L(1,\chi)$ error terms to deal with, only the single one where $\chi=\chi\_1$.


