Claude Shannon's 1948 paper "A Mathematical Theory of Communication" founded information theory by asking how to measure information. His answer starts from a single event: the less likely it is, the more you learn when it happens.
We will compute surprisal and finish with why it is a logarithm.
Step 1: Surprisal
Learning that an event of probability p occurred gives
A fair coin flip gives 1 bit, an event of probability ¼ gives 2 bits, one of probability 1/16 gives 4, and one of probability 1/1,024 gives 10. A certain event gives none. Learning that a fair die showed an even number gives 1 bit, since that event has probability ½. The base of the logarithm sets the unit: base 2 gives bits.
Step 2: Why the logarithm
Information from independent events should add: learning two unrelated facts should tell you the sum of what each tells you. Independent probabilities multiply, and the logarithm turns products into sums:
Two independent events of probabilities ½ and 1/32 together give 1 + 5 = 6 bits. The logarithm is the only measure, up to a constant factor (the choice of base, or unit), that is additive over independent events and decreases as probability rises.