Add log for encode/decode message.