proper logging of messages