Equality in the logarithmic Sobolev inequality