MNT: log upstream before closing the connection