Logarithm Inverse of an Exponential Function
Key Questions

Definition
#log_bx=y# if and only if#b^y=x# Logarithmic functions are the inverse of the exponential functions with the same bases.
Example
If you wan to find the value of
#log_2 8=?# ,then convert the question in terms of exponential function
#2^{?}=8=2^3 => ?=3# .Hence,
#log_2 8=3# .
I hope that this was helpful.

Answer:
See explanation, where I show how to find
#log_2(7) ~~ 2.8# Explanation:
Since you were not specific as to what base of logarithm you wanted, I will take the liberty of showing you how to calculate logarithms base 2 in binary. They are perhaps the easiest to do by hand. Elsewhere I have shown a method to calculate common (base
#10# ) logarithms, but that involves a lot of raising numbers to the#10# th power so is rather tedious.Let us calculate
#log_2 7# .From now on express numbers in binary...
We want to calculate
#log_(10_2) 111_2# #10_2^(10_2) = 100_2 < 111_2 < 1000_2 = 10_2^(11_2)# So the digits before the binary point are
#color(blue)(10)# Next divide
#111_2# by#10_2^(10_2)=100_2# to get#1.11_2# Square
#1.11_2# to get#11.0001_2# Since this is greater than
#10_2# , the first digit after the binary point is#color(blue)(1)# Divide by
#10_2# to get#1.10001_2# Square
#1.10001_2# to get#10.0101100001_2# Since this is greater than
#10_2# , the second digit after the binary point is#color(blue)(1)# Divide by
#10_2# to get#1.00101100001_2# Square
#1.00101100001_2# to get#1.0101111111011011000001_2# Since this is less than
#10_2# , the third digit after the binary point is#color(blue)(0)# Square
#1.0101111111011011000001_2# to get#1.11100011100110100101000001010111110110000001_2# Since this is less than
#10_2# , the fourth digit after the binary point is#color(blue)(0)# To cut down on the arithmetic, I will approximate this as
#1.11100011100110100101_2# Square
#1.11100011100110100101_2# to get#11.1001000110001111101001101110010001011001_2# Since this is greater than
#10_2# , the fifth digit after the binary point is#color(blue)(1)# Divide by
#10_2# to get#1.11001000110001111101001101110010001011001_2# I'll stop here, but I hope you get the idea.
Putting the digits we have found together we get:
#log_(10_2) 111_2 ~~ 10.11001_2 = 2+25/32 ~~ 2.8# Actually
#log_2(7) ~~ 2.80735# 
The logarithm base
#b# of a number#n# is the number#x# that when#b# is raised to#x# th power, the resulting value is#n# #log_b n = x <=> b^x = n# Example:
#log_2 8 = x# #=> 2^x = 8#
#=> 2^x = 2^3#
#=> x = 3# #log_5 1 = x#
#=> 5^x = 1#
#=> 5^x = 5^0#
#=> x = 0# 
Logarithms of negative numbers are not defined in the real numbers, in the same way that square roots of negative numbers aren't defined in the real numbers. If you are expected to find the log of a negative number, an answer of "undefined" is sufficient in most cases.
It is possible to evaluate one, however, the answer will be a complex number. (a number of the form
#a + bi# , where#i = sqrt(1)# )If you're familiar with complex numbers and feel comfortable working with them, then read on.
First, let's start with a general case:
#log_b (x) = ?# We will use the changeofbase rule and convert to natural logarithms, to make things easier later:
#log_b(x) = ln(x)/lnb# Note that
#ln(x)# is the same thing as#ln(1 * x)# . We can exploit the addition property of logarithms, and separate this part into two separate logs:#log_b(x) = (lnx + ln(1))/lnb# Now the only problem is figuring out what
#ln(1)# is. It might look like an impossible thing to evaluate at first, but there is a pretty famous equation known as Euler's Identity that can help us.Euler's Identity states:
#e^(ipi) = 1# This result comes from power series expansions of sine and cosine. (I won't explain that too indepth, but if you are interested, there is a nice page here which explains a bit more)
For now, let us simply take the natural log of both sides of Euler's Identity:
#ln e^(ipi) = ln(1)# Simplified:
#ipi = ln(1)# So, now that we know what
#ln(1)# is, we can substitute back into our equation:#log_b(x) = (lnx + ipi)/lnb# Now you have a formula for finding logs of negative numbers. So, if we want to evaluate something like
#log_2 10# , we can simply plug in a few values:#log_2(10) = (ln10 + ipi)/ln2# #approx 3.3219 + 4.5324i# 
Log base "a" of "x" is the same quotient of log base"b" of "x" and log base "b" of "a".
This allows us to convert a base that is not easily solvable into the division of of logs with common base that is easy to solve.
#log_a(x)=(log_b(x))/(log_b(a))# #log_10(100)=(log_e(100))/(log_e(10))=(ln(100))/(ln(10))=2#