Logging. Exit from CP by close button click.