Decimals
As for the number of digits of a number in the decimal system. consider the following:
Let $x$ be any real number - for our convenience, assume it is positive. Then, obviously, there exists exactly a natural number $n\in\mathbb{N}$ such that:
$$10^n\leq x<10^{n+1}$$
Now, if a number is between $10^n$ and $10^{n+1}$, as above, it means that it has exactly than $n+1$ digits. Imagine $x=9468$, for instance. In this case, $n=3$, since:
$$10^3=1000\leq9468<10,000=10^4$$
So, we would like to express $n$ in terms of $x$, so as to have a formula that, given $x$, returns $n+1$. Since $n$ is appearing as an exponent of $10$, we think that taking $\log_{10}$ on every side is a way to "get $n$ out of the exponent". So, we have that:
$$\begin{align*}
&10^n\leq x<10^{n+1}\\
\Leftrightarrow&\log_{10}10^n\leq\log_{10}x<\log_{10}10^{n+1}\\
\Leftrightarrow&n\leq\log_{10}x<n+1
\end{align*}$$
So, $n=\lfloor\log_{10}x\rfloor$ which means that the number of digits of $x$ is exactly:
$$n+1=\lfloor\log_{1}x\rfloor+1$$
Logarithms
Now, as for the logarithms, let us remind the definition:
Given $x,b>0$, $\log_bx$ is the - only - number that has the following property:
$$b^{\log_bx}=x$$
So, the logarithm of $x$ with base $b$ is the only number which can be the exponent of $b$ such that $b$ to that exponent is equal to $x$.
So, given the symbol $\log_bx$, $b$ being the logarithms base means that $b$ is the number to which we may set $\log_bx$ as an exponent to get $x$. You can imagine the following game that helped me understand logarithms:
The Log-Game
Imagine two friends, Alice and Bob - hehe, these are probably the only friends we, mathematicians, have ever heard of - have a secret code to exchange messages. So, every message they want to send is being turned into a - probably very large - number. So, in our case, Alice and Bob are exchanging numbers in order to communicate.
But, in order to make it more difficult for other people to read their messages and find out the code, they use the following trick:
If $x$ is the message Alice wants to send to Bob, then, instead of this Alice sends Bob another number, which is $\log_b x$, for some base $b$ that they have pre-decided.
So, Bob receives a number $y$ that is not the message he wants, and, probably, has no meaning at all. How will he find the message? As mentioned above, Alice and Bob have pre-decided a base for the logarithms they are exchanging, so, what Bob has to do is to calculate:
$$b^y=b^{\log_bx}=x$$
since, by the definition of logarithm, the only way to find $x$ given $y=\log_bx$ is to set it as an exponent to $b$. Every other, not knowing the exact value of $b$ cannot find that message.
Over-decimal Systems
We have heard about decimal system, binary system etc. But, the most usual case is that we use the usual symbols $0,1,2,\dots,9$ for such systems. What about hexadecimal system? There, we need $16$ different - distinct - symbols for our elementary digits. So, we introduce $6$ new symbols: $A,B,C,D,E,F$. These are just symbols, as the previous ones; $0,1,2,\dots,9$. There is no matter about that.
To make it a little more clear, we have decided that:
$$0+1=1,\ 1+1=2,\ 2+1=3,\dots,8+1=9$$
Moreover, we have decided that
$$9+1=10,\ 99+1=100$$
Or, to be more precise, the nature of our enumerating system - that the position of a digit is important to its evaluation - is a property that makes it feasible to use only some - finite in number - symbols and not infinitely many or strange combinations - see, for instance, the roman digits.
We have been used to using these symbols to represent numbers, which has driven us to the wrong conclusion that these symbols are the numbers they represent. Well, no symbol is any number, it just represents one, probably different with respect to our system.
For instance, in binary system:
$$101$$
represents what in the decimal system we would write as:
$$5$$
or what in the ternary (3) system we would write as:
$$12$$
or what in the hexadecimal system we would write as:
$$5$$
So, if we want to use some enumeration system with more that $10$ elementary digits, we have to introduce some new symbols for these digits and we also have to define the basic operations with them. So, in hexadecimal system we deicide that:
$$9+1=A,\ A+1=B,\ B+1=D,\dots,E+1=F$$
and all the other properties we know.
So, to find how many elements a number $x$ has in hexadecimal, we simply note that there exists exactly on $n$ such that:
$$16^n\leq x<16^{n+1}$$
and, with the same thoughts as above, we take $\log_16$ to every side, so we have:
$$n\leq\log_{16}x<n+1$$
and, we have, finally that number $x$ in the hexadecimal system has:
$$\lfloor\log_{16}x\rfloor+1$$
digits.