I don't understand what you mean. Do you want the program that crashes to write a log to a file upon its crash or do you want the server on which it ran to log out of the user session that was used to log onto the server in order to run the program (assuming program isn't a windows service that runs under system user. ..)