The examples of LogWriteCustomString refer to .ilg file. I'm not sure what that is. What I want to do is write information to a log file that is specified by msiexec /L parameter. Is there a different API that I should look into?
Yup. If you're trying to do this from an InstallScript custom action in a Windows Installer project, you're looking for SprintfMsiLog.
(InstallScript tracks what the installation performed so it can undo it during uninstallation, and does so in what it calls a log; LogWriteCustomString operates on that log instead of the Windows Installer log.)