Proving this identity using summation by parts This problem was left as an exercise from the notes which I am self studying and I am not able to get any ideas on how to solve it.
Problem:  Let $$\pi(x;q,a)=\#\{p \leq x : p=a \mod q\}$$ and $$\psi(x; q,a)= \sum_{n\leq x ,  n= a \mod q} \Lambda(n)$$
The prime number theorem for arithmetic progressions states that if $\gcd(a,q)=1$, then as $n\to \infty$ ($q$ fixed),
$$\pi (x;q,a) = \frac{1} {\psi(q)} \text{Li}(x) + O(x e^{-c (\log x)^{1/2}})$$ and $$\psi(x;q,a) = \frac{x} {\psi(q)} +O( x e^{-c (\log x)^{1/2}})$$
Applying Summation by parts, $$\sum_{ p\leq x, p=a \mod q } \frac{\log p}{p} = \frac{1} {\phi(q)} \log x +O(1) $$

I am not able to deduce that how by applying summation by parts I will get the required result. I thought of using Abel's identity and Euler summation formula but I am  not able to understand how to deal with $p=a (\mod q) $ that is in the summation.

Can you please help me in proving this?

It follows from the second identity that
$$
\vartheta(x;q,a)=\sum_{\substack{p\le x\\p\equiv a(q)}}\log p={x\over\varphi(q)}+O(xe^{-c(\log x)^{1/2}}),
$$
allowing us to perform partial summation as follows:
\begin{aligned}
\sum_{\substack{p\le x\\p\equiv a(q)}}{\log p\over p}
&=\int_{2^-}^x{\mathrm d\vartheta(t;q,a)\over t} \\
&={1\over\varphi(q)}\int_2^x{\mathrm dt\over t}+\int_{2^-}^x\frac1t\mathrm d\left\{O(te^{-c(\log t)^{1/2}})\right\} \\
&={\log x\over\varphi(q)}+O(1).
\end{aligned}
