The $\log$ function is the inverse function to the exponential function. Thus, the number $x=\log_a b$ is the number that solves the equation $a^x = b$.

Apply this to your example: what is $x=\log_4 2$? To what power must you put $4$ to get $2$? Well, you know that $\sqrt 4 = 2$, right? Well, since $\sqrt a = a^{\frac12}$, this means that $4^{\frac12}=2$, and by definition, $\frac12 = \log_4 2$

How do write that little base after log. I don't know how to express mathematical sign on this site. Can you post me link where i can read it. So, people can understand my question better
–
Abhimanyu AryanJul 8 '14 at 9:17

1

In general, to get subscript this in MathJax, you need to put the expression in between dollar signs and use an underscore to get the subscript. There is a MathJax tutorial here.
–
Old JohnJul 8 '14 at 9:18

Just to note that here you can take the obvious equation $4=2^2$ and take logs to base $4$ so that $$\log_4 4 = 2\log_4 2$$ or $$2\log_4 2=1$$

This is, of course, wholly equivalent to what others have said, and is not a general formula - but as a means of practical calculation e.g. in an exam under pressure - it could help you to avoid mistakes.