Classical statistical mechanics: dimensions of partition function

The partition function in the classical theory is an integral over phase space. Thus, the partition function is often not dimensionless. Then the formula
[tex] F = -T \log Z [/tex]
can no longer be valid, as you can only take the logarithm of a dimensionless number. In the quantum theory, this problem is easily taken care of by dividing out by Planck's constant and asserting that the method of integration is not really valid anyway. How are the dimensions taken care of in a classical setting?