The periodic KdV equation u_t=u_{xxx}+\beta uu_x arises from a Hamiltonian
system with infinite-dimensional phase space L^2(T). Bourgain has shown that
there exists a Gibbs measure \nu on balls \{\phi :\Vert\Phi\Vert^2_{L^2}\leq
N\} in the phase space such that the Cauchy problem for KdV is well posed on
the support of \nu, and \nu is invariant under the KdV flow. This paper shows
that \nu satisfies a logarithmic Sobolev inequality. The stationary points of
the Hamiltonian on spheres are found in terms of elliptic functions, and they
are shown to be linearly stable. The paper also presents logarithmic Sobolev
inequalities for the modified periodic KdV equation and the cubic nonlinear
Schr\"odinger equation, for small values of N