Custom variable for log location resolving for PSADT logs but not MSI logs

When I used variables with values set in Deploy-Application.ps1 in the <Toolkit_LogPath> XML node, I encountered the same problem discussed in this other thread.