You can first extract the pdb/crd files from log files and then use these extracted file to calculate dihedral angles using any tools(i.e., CHARMM, Gromacs etc). There also other structural analysis tools to extract dihedrals.
Gaussview, the GUI of Gaussian can do that too. Although I'm not sure whether you need it in any specific format or not.
Just open the .log file in Gview> Tools> atom list editor. (make sure 'Z-matrix column' is showing otherwise activate it) Go to Rows> Select All, and from the file option you can export data in .txt format.
You can also select specific rows or hide few other columns which you don't need in order to make the .txt file more convenient.