use the "screen" command to create a screen server on the client machine (server) and connect to this screen session from your computer using ssh (ssh to the server) then you can try to use "tee" or I don't know what to log everything, but it will mostly log control sequences, which are not really useful to you.
An other solution would be to use git to store various revision of the file and hook inotify to commit every time the file is closed. This should output you a nice diff all modifications. This plus the real time screen sessions and you should be in business. This will not log the commands executed, but there is .bash_history for that (but it can be bypassed or edited afterward, ot even never loged in the first place if bash is killed).
Last edited by Elv13; 11-29-2010 at 05:04 PM.