Hmmm, I forgot about that. So I should have asked: "Is there a way to make tor log the circuits it uses (or maybe a way for a local script to periodically ask tor about the circuit)?"
Kees
You can send queries to Tor through its control port (9051 by default). You may either poll Tor's status periodically using GETINFO calls, or ask Tor to send asynchronous updates using SETEVENTS. Detailed specs are here: <http://tor.eff.org/svn/trunk/doc/control-spec.txt>