I want to expand on the comment of @math54321 and the answer of @Dietrich Burde.
If we write a non-zero natural number $n$ as $n = \sum_{j = 0}^{m} a_j 10^j$, where $a_j \in \{ 0,1,2,3,4,5,6,7,8,9 \}$ and $a_m \neq 0$, i.e. as its decimal expansion, then we get that
$$ m \leq \log_{10} \left( \sum_{j = 0}^{m} a_j 10^j \right) < m +1,$$
which can be rewritten as
$$ \lfloor \log_{10}(n) \rfloor = m. $$
This is of course analogous to the degree of a polynomial $\sum_{j = 0}^m a_j X^j$, which is precisely $m$ (under the assumption that $a_m \neq 0$).
For completeness, let's prove this: First notice that the logarithm is non-decreasing. So since $a_m 10^m \leq \sum_{j = 0}^{m} a_j 10^j$, we get
$$ \log_{10} \left( a_m 10^m \right) \leq \log_{10} \left( \sum_{j = 0}^{m} a_j 10^j \right). $$
The lower bound is equal to $\log_{10} (a_m) + \log_{10} (10^m) $, which is always larger than $\log_{10}(10^m)$, since $a_m \geq 1$. In total
$$ m = \log_{10} (10^m) \leq \log_{10} \left( \sum_{j = 0}^{m} a_j 10^j \right). $$
On the other hand, we can estimate $\sum_{j = 0}^{m} a_j 10^j$ as follows: The worst case is that all $a_j$ are equal to $9$. So $ \sum_{j = 0}^{m} a_j 10^j \leq \sum_{j = 0}^{m} 9 \cdot 10^j $ is the best we can do. But this is a geometric sum and can be simplified to
$$ \sum_{j = 0}^{m} 9 \cdot 10^j = 9 \frac{1 - 10^{m+1}}{1 - 10} = 10^{m+1} - 1. $$
For the logarithm we then get
$$ \log_{10} \left( {\sum_{j = 0}^{m} a_j 10^j} \right) \leq \log_{10} (10^{m+1} - 1) < \log_{10} (10^{m+1} ) = m +1.$$
This concludes the proof!
If $n = 0$, then $\log_{10}(0)$ can be seen as $\lim_{x \to 0} \log_{10} (x) = - \infty$, which also coincides with the degree of the zero polynomial being $- \infty$.
So here we have a precise analogy between the logarithm and the degree of a polynomial. This of course also works for all other bases other than $10$.