Use the dribble command to capture a lisp session:

 

[1]> (dribble "hw1.txt")         ; opens file, starts logging

#<OUTPUT BUFFERED FILE-STREAM CHARACTER #P"hw1.txt" @1>

 

[3]> (dribble)                   ; turns off logging

#<CLOSED OUTPUT BUFFERED FILE-STREAM CHARACTER #P"hw1.txt" @1>

 

if the file already exists, dribble will append new output to the existing file.  Otherwise, dribble creates a new file.