relay: cleanup and make logging have a hight priority