You can enable logging specifically for the %post section of your kickstart (I am assuming kickstart because you state "unattended install" via anaconda; kickstart is the most likely method that I know of.)
%post [--erroronfail] [--interpreter /usr/bin/python] [--log LOG] [--nochroot]
There are several examples in the RHEL7 Installation Guide official documentation. Even if you aren't installing RHEL, the kickstart/anaconda system is very stable and uniform across distributions that use it. Directly from the document:
# Start of the %post section with logging into /root/ks-post.log
%post --log=/root/ks-post.log
# Mount an NFS share
mkdir /mnt/temp
mount -o nolock 10.10.0.2:/usr/new-machines /mnt/temp
openvt -s -w -- /mnt/temp/runme
umount /mnt/temp
# End of the %post section
%end
In the same document I suggest you check section 26.3 Kickstart Syntax Reference, specifically:
- 26.3.5 Post-installation script
- 26.3.6 Kickstart error handling
The official 'kickstart' documentation is also decent but sometimes sparse, and it is hard to find.
https://pykickstart.readthedocs.io/en/latest/