As MQTT-284 we added a Reason String to CONNACK and DISCONNECT. When we resolved that issue we decided to open another issue to put a similar Reason String on the ACK packets (PUBACK, PUBREC, PUBREL, PUBCOMP, SUBACK, and UNSUBACK). It was also felt that when putting a more problem determination information on ACKs, we would want to make this something the client could request.
The starting proposal is to add Id/Value pairs to all of the ACK packets. This would be at the end of the variable header following the return code. If the packet length is less that the position of the Id/Value length a lengh of zero is assumed. This is to continue to allow the very common case of a good ACK of minimal size. Add the Reason String similar to CONNECT and DISCONNECT to these packets.
In addition add a Request Debug setting to the CONNECT packet. This field has 4 possible values with a default of normal.
1 = quiet (little or no debug info)
2 = normal (minimal debug info)
3 = verbose (more debug info)
4 = debug (maximum debug info)
The debug info does not only consist of setting the Reason String in the protocol, but could also include out of band problem determination such as increased logging. The spec does not define a requirement of the server to honor this setting or define exactly what information is sent. Indeed the server should balance this request from the client with security concerns. It does give the client the ability to increase this level when trying to debug problems, and lowering it for normal production use.