The thermodynamic free energy is defined by $F=U-TS$ with $U,T,S$ being the internal energy, temperature and entropy respectively.
I have also seen another formula for the free energy, $F=-T \log{Z}$ where $Z=\int \cal{D} \phi e^{-I[\phi]}$ is the partition function.
First of all, I'm not sure the $Z$ in the log is the same as the one I've defined in the path integral. Can someone confirm this please? Secondly, how can I show these two definitions of free energy are equivalent?