$P$ is a projection operator in the limiting case where $P$ represents a state that is completely known, i.e. a pure state, so the entropy is zero. As a limiting case, the valid and well-defined mathematical description is
$$\lim_{P \rightarrow 0^+} P \log(P)=0.$$
This is still a bit sloppy. Since $P$ is a matrix, we're actually taking the trace and $P \rightarrow 0^+$ means as P goes to a representation of a pure state. It's a bit more clear to consider entropy in terms of the eigenvalues of $P$,
$$S=\sum \lambda_i \log \lambda_i,$$
so that there is no ambiguity in interpreting
$$\lim_{\lambda \rightarrow 0^+} \lambda \log(\lambda)=0,$$
for any given term in the sum.
In response to your comment, when $P$ is a projection operator, the expression $\log(P)$ is inherently undefined. You can see this by noting that projection operators are idempotent by definition, so $P^2=P$.
Consider the proposition that we can express $P$ in exponential form $P=e^x$ for some unknown $x$. The idempotentcy of $P$ requires $e^x=e^{2x}$, which tells us that $x$ is imaginary with magnitude $2 \pi n, \, n \in \mathbb{Z}$, over some $d$-dimensional basis.
Whatever appropriately normalized basis we pick, say $b_d$, the inevitable result is $e^{i2\pi n b_d}=I_d$. So we get back the identity instead of our projection operator, contradicting the proposition.
The is one of several ways to see that we can't define $P$ as an exponential, and that $\log(P)$ is hopelessly undefined.