I googled around for a bit and found a neat article:
Rather than building logging into your telnet application, why not build a wrapper that you can use with any program? That's what 'script' is. Just run the command and tell it where to output the data.
"script -c "telnet myhost.domain.com" /tmp/output.log"