Updated chat.pl to create log information on exit