I do a fair amount of debugging via serial port, and I usually use minicom as a terminal, where all the debug output gets dumped. Sometimes, however, I want to run experiments and just log the output. This is an area where minicom struggles.
I am now using a program called interceptty which can sit between a real or fake serial port and an application. I’m using it to redirect serial port data to a local network socket, and then using netcat to log the data to a file. Interceptty can log the data itself, but it is designed around logging binary data, and I am actually in a situation where most of what comes through is displayable ASCII.
interceptty -s 'ispeed 115200 ospeed 115200' -o interceptty.raw.log /dev/ttyS1 @localhost:6666
netcat localhost 6666 | tee -a serial_ascii.txt