Let $X$ be a smooth, projective curve over a field $k$ (characteristic zero is enough for me) and $E$ a line bundle on $X$. Assume that $E$ is equipped with an integrable logarithmic connection $\nabla: E \to E \otimes \Omega^1_X(\log D)$, where $D$ is some reduced divisor on $X$. Then, for each point $x$ of $D$ there is a residue $\mathrm{Res}_x(\nabla)$ which belongs to the residue field of $x$. I am trying to figure out what the residue formula looks like in this situation. The obvious thing to consider is $$ \sum_{x \in D} \mathrm{Tr}_{k(x)/ k} Res_x(\nabla) $$ but I don't have the impression that this is always zero. So is it possible that one has something like $$ \sum_{x \in D} \mathrm{Tr}_{k(x)/ k} Res_x(\nabla)=-\sum_{x \in X-D} [k(x) \colon k] \mathrm{ord}_x(e) $$$$ \sum_{x \in D} \mathrm{Tr}_{k(x)/ k} Res_x(\nabla)=-\sum_{x \in X-D} [k(x) \colon k] \mathrm{ord}_x(e) \quad \quad \quad (\ast) $$ for a rational section $e$ of $E$. If so, any idea how to prove it?