implemented lightweight exception logging.