Did you look at the programs available in Synaptic? For example, twlog or xlogmight do what you need.