For a given integer $m$, I'm looking for a classification of all polynomials $P$ with rational coefficients satisfying the logarithm-like condition
$$P(ab)=P(a)+P(b) \pmod 1$$
for any integers $a, b$ coprime to $m$.
I'm interested in these polynomials because they can be used to define Dirichlet characters of the form
$$\chi_P(n) = \begin{cases} 0, & \gcd(n,m)>1 \\ e^{2\pi i P(n)}, & \gcd(n,m)=1\end{cases},$$
using the fact that the sequence $n \mapsto P(n) \pmod 1$ is periodic for any rational polynomial $P$.
I consider two rational polynomials equivalent if they induce the same polynomial function modulo $1$ on integers coprime to $m$, i.e., if the associated characters are the same. Note that the logarithm-like condition implies that $P(1) = 0 \pmod 1$, so up to equivalence it can be assumed that $P(1) = 0$, that is, $(x-1)|P$.
The only examples of logarithm-like polynomials I've been able to find so far are equivalent to integral linear combinations of the degree $N$ polynomials $$P_{N,m}(x)=\frac{x^N - 1}{\Delta_{N,m}^2},$$ where $\Delta_{N,m} = \gcd\limits_{(a,m) \text{ coprime}}(a^N-1)$. It is easy to prove that these polynomials satisfy the logarithm-like condition by an argument similar to the one in this answer. Not all of these polynomials will be inequivalent in general, e.g. all the polynomials with $N$ odd are equivalent to each other.
For instance, if we fix $m=k!$, in the limit of big $k$ the resulting sequence of polynomials $P_{N}(x) = \lim_{k\to \infty} P_{N,k!}(x)$ becomes
$$P_{1}(x) = \frac{x-1}{2^2}, \: P_{2}(x) = \frac{x^2-1}{24^2}, \: P_{3}(x) = \frac{x^3-1}{2^2}, \: P_{4}(x) = \frac{x^4-1}{240^2}, \: P_{5}(x) = \frac{x^5-1}{2^2}, \: P_{6}(x) = \frac{x^6-1}{504^2}, \cdots$$
(as a curiosity, $\Delta_{N}$ for $N>1$ equals twice the denominator of the rational number $\zeta(1-N)$, where $\zeta$ is the Riemann zeta function). Note that $P_{N,m}$ is an integral multiple of $P_N$ for any $m$, so all the examples I know can be expressed up to equivalence as $\sum_{N=1}^{N_{\text{max}}} a_N P_N(x)$ with $a_N \in \mathbb{Z}$.
Are there any other examples, up to equivalence?
EDIT:
Here is a possible strategy to show that the examples above are the only ones. Consider a polynomial $P(x) = \sum_{N=0}^{N_{\text{max}}} p_N x^N$ with $p_N \in \mathbb{Q}$ that satisfies the logarithm-like condition for some $m$. This condition can be reexpressed as
$$\mathbb{Z} \ni P(ab)-P(a)-P(b) = \sum_{N=0}^{N_{\text{max}}} p_N ((ab)^N-a^N-b^N) =$$
$$= \sum_{N=0}^{N_{\text{max}}} p_N (a^N-1)(b^N-1) - \sum_{N=0}^{N_{\text{max}}} p_N.$$
But the last sum is equal to $P(1)$, which by the remarks above may be taken to vanish. Hence we must have
$$\sum_{N=0}^{N_{\text{max}}} p_N (a^N-1)(b^N-1) = \sum_{N=0}^{N_{\text{max}}} q_N \frac{a^N-1}{\Delta_{N,m}}\frac{b^N-1}{\Delta_{N,m}} \in \mathbb{Z},$$
where $q_N = p_N \Delta_{N,m}^2$. This must hold true as $a,b$ range over all integers coprime to $m$. If we can show that $q_N \in \mathbb{Z}$ for all $N$, we will have proved that $P(x) = P(x)-P(1) = \sum_{N=0}^{N_{\text{max}}} q_N (x^N-1)/\Delta_{N,m}^2$ is an integral linear combination of $P_{N,m}(x)$, and thus that the answer to my question is negative.
Showing that the $q_N$ are integers for all $m$ amounts to showing that the set of vectors
$$\Sigma_m = \left\{ \left(\frac{a-1}{\Delta_{1,m}}\cdot\frac{b-1}{\Delta_{1,m}}, \frac{a^2-1}{\Delta_{2,m}}\cdot\frac{b^2-1}{\Delta_{2,m}}, \ldots, \frac{a^{N_{\text{max}}}-1}{\Delta_{N_{\text{max}},m}}\cdot\frac{b^{N_{\text{max}}}-1}{\Delta_{N_{\text{max}},m}} \right) \middle\vert a,b \text{ coprime to } m \right\},$$
whose entries are integral by definition of $\Delta_{N,m}$, is a spanning set for $\mathbb{Z}^{N_{\text{max}}}$, since in that case the covector $(q_1,q_2,\ldots, q_{N_{\text{max}}})$ must belong to the dual lattice of $\mathbb{Z}^{N_{\text{max}}}$, which is again $\mathbb{Z}^{N_{\text{max}}}$.
This seems intuitively plausible after some numerical experimentation (it says that the numbers $\frac{a^N-1}{\Delta_{N,m}}$ for $N=1, 2, \ldots$ are essentially "uncorrelated"), and it can be easily checked for specific values of $m$, but I'm not sure how to prove that it holds in general for arbitrary $m$ and $N_{\text{max}}$.
EDIT 2:
The problem is more interesting than I thought: the proof strategy above fails because, as I just found, there do exist logarithm-like polynomials for which $q_N$ are noninteger. Two of these are $\frac12 P_{2,3} + \frac12 P_{1,3}$ and $\frac1{12} P_{3,2} - \frac1{12} P_{1,2}$. I had missed them before because they turn out to be equivalent to polynomials with integer $q_N$. E.g. the former polynomial is equivalent to $-P_{2,3}$, and the latter is $4P_{2,2}$. I still suspect that any logarithm-like polynomial is equivalent to one of that form, but the existence of these equivalences somewhat complicates things.
As suggested by Merosity in the comments, another possible idea is to work one prime at a time by taking the $p$-adic fractional part. We have $\{P_N\}_p = k_p P_{N,p}$, where $k_p$ is some integer coprime to $p$, so any logarithmic-like polynomial can be decomposed into (finitely many) $p$-parts $P \cong \sum_p \{P\}_p$, where each $\{P\}_p$ would be then conjecturally equivalent to an integral linear combination of $P_{N,p}$. The problem would thus reduce to trying to prove the cases with $m=p$ first, and then finding a way to combine each individual proof into one that works for composite $m$. A possible advantage of this approach is that $\Delta_{N,p}$ has a very simple expression (for odd primes it is $\Delta_{N,p}=p^{r+1}$ where $r$ is the maximum integer such that $p^r(p-1)|N$, and for $p=2$ it's something similar but slightly different). However, even in this simplified setting one runs into "exotic" equivalences like the ones above, so I haven't been able to make much progress so far.
EDIT 3:
I apologize for so many edits, this is the last one for a while. I still haven't made progress on a proof, but I can't help but mention that the same phenomenon seems to hold for many other number rings $R$, such as the Gaussian and Eisenstein integers $\mathbb{Z}[i]$ and $\mathbb{Z}[\omega]$, or even orders in function fields like $\mathbb{F}_q[t]$, if we replace $P(x)$ by $P(|x|)$, where $|x|$ is the canonical (integer-valued, multiplicative) norm, and let $m$ be any element of $R$.
We then have that $\Delta^{(R)}_{N,m}$ (under the same definition as above) is related to the denominator of the Dedekind or Hasse-Weil zeta function associated to $R$, and the corresponding $P^{(R)}_N(|x|)$ again seem to form an integral spanning set of the logarithm-like "norm polynomials" valued in $R$, up to equivalence. I wonder if my conjecture would be easier to prove or disprove over some of these rings instead of $\mathbb{Z}$; I don't have much experience working with function fields myself, but I do know that proofs are sometimes easier to find in that setting.
For now I'm adding a bounty since I ran out of ideas. Any answer that makes a significant step towards the classification (over some ring) would be appreciated, even if it's not a full proof.