Remove newlines from logging message to prevent message from being sent prematurely.