Added message encoding to logging