Asymptotic formula for the average number of zeros of a polynomial modulo p Let $f$ be a non-constant polynomial with integers coefficients, and for each prime number $p$ let $\eta_f(p)$ be the number of zeros of $f$ modulo $p$. It is known that the average (in the natural way) of $\eta_f(p)$ among all primes $p$ is equal to the number $r$ of irreducible factors of $f$ in $\mathbb{Q}[X]$. (On p. 32 of [1] this result is attributed to Kronecker.)
I am looking for a reference to an asymptotic formula like:
$$(1)\quad \sum_{p \leq x} \eta_f(p)\,\frac{\log p}{p} = r \log x + \text{Good error term}.$$
(Or something from which (1) could be obtained by partial summation.)
I know that (1) can be proved using Chebotarev density theorem and Burnside's lemma (and, if I am not wrong, the error term should be $O(1)$). Anyway, I am interested in a reference from a book or an article. 
Thank you in advance for any help.
[1] P. Stevenhagen and H. W. Lenstra, Chebotarëv and his density theorem,  Math. Intelligencer 18 (1996), no. 2, 26–37. 
EDIT: If instead $f$ is a non-constant polynomial with coefficients in the ring of integers $\mathcal{O}_k$ of a number field $k$, and $\eta_f(p)$ is the number of $n \in \{0, 1, \ldots, p-1\}$ such that $f(n) / p$ is an algebraic integers, does something like (1) still hold? With which constant instead of $r$?
 A: Your statement is essentially Mertens' theorem for number fields. Apparently a reference is
M. Rosen, A generalization of Mertens’ theorem, J. Ramanujan Math.
Soc. (1) 14 (1999), 1–19
However it requires a little bit of effort to transform this into your problem. You might not be satisfied by that.
Clearly it's sufficient to do this for irreducible polynomials $f(x)$ In this case, let $K = \mathbb Q(\alpha)$, $\alpha$ a root of $f(x)$.
The number field analogue of Mertens' first theorem shows that  $$\sum_{\mathfrak p \in \mathcal O_K, |\mathfrak p|<x} \frac{ \log |\mathfrak p|}{  |\mathfrak p|} = \log x +O(1) $$
This bound implies what you want because the number of primes of $\mathcal O_K$ of norm $p$, $p$ not dividing the  discriminant of $f$, is exactly $n_f(p)$. The remaining contributions, consisting of prime powers, of primes with prime power norm, and of primes dividing the discriminant, can all be bounded as $O(1)$ by standard methods.

For your edited question, let $e_1,\dots,e_k\in \mathcal O_K$ be a $\mathbb Z$-basis of $\mathcal O_K$. write $f(x) = \sum_{i=1}^k f_i(x) e_i$ where each $f_i(n)$ has rational coefficients. After throwing out the primes $p$ dividng the denominators of $f_i(x)$, $x \in \{0,\dots,n-1\}$ satisfies $f(x) \in p \mathcal O_k$ if and only if $f_1(x),\dots,f_k(x)$ all vanish.
There are two possibilities - either a single polynomial divides all the $f_i(x)$, or not.
If a single polynomial divides all of them then we are back in the first situation with that polynomial.
If not, then the $f_i(x)$ generate the unit ideal in $\mathbb Q[x]$, so they generate the ideal $(N)$ in $\mathbb Z[x]$ for some natural number $N$. Thus they can only have a common zero mod $p$ if $p$ divides $N$. 
So for a typical polynomial $f$ (i.e.in the second case) there are only finitely many solutions.
A: It is also possible to handle this problem using the theory of frobenian functions, due to Serre. You can find the relevant definitions and proofs in Serre's well-written book "Lectures on $N_X(p)$" (see e.g. Sections 2.1 and 3.3).
The function $\eta_f(\cdot)$ is frobenian of mean $r$ (this is Proposition 3.10 from Serre's book). As stated in Section 3.3.3.5, the Chebotarev density theorem yields the asymptotic formula
$$\sum_{p \leq x} \eta_f(p) =   r \mathrm{Li}(x) + O(xe^{-c \sqrt{\log x})}), \quad x \to \infty,\phantom{123}$$
where the error term is the usual error term from the prime number theorem.
An asymptotic formula with an explicit error term for the sum of the type you want now follows from a simple application of partial summation.
