When you have an exponentiation on the form by, b is called the base and y is called the exponent. What the log functions returns is the exponent. Don't confuse the word base with how it's used when talking about numeral systems (hex, dec, etc.). They mean different things.
It's just a matter of solving the equation.
x = 10y
y = log10(x)
x = 2y
y = log2(x)
x = ey
y = log(x)
These equations are usually not easy to solve by hand so that's why we can use the functions. As you probably have noticed we don't have a log function for arbitrary bases, so it's a hard problem to solve efficiently even for a computer.