  Starting from the definition of entropy used in statistical mechanics we show
that it is proportional to the gravity action. For a stationary black hole this
entropy is expressed as $S = E/ 2T$, where $T$ is the Hawking temperature and
$E$ is shown to be the Komar energy. This relation is also compatible with the
generalised Smarr formula for mass.
