Improve logging of messages