Skip to content

Change EMQX Log Level

Task Target

Modify the log level of EMQX cluster.

Configure EMQX Cluster

The following is the relevant configuration of EMQX Custom Resource. You can choose the corresponding APIVersion according to the version of EMQX you want to deploy. For the specific compatibility relationship, please refer to EMQX Operator Compatibility:

Verify Log Level

MQTT X CLI is an open source MQTT 5.0 command line client tool, designed to help developers to more Quickly develop and debug MQTT services and applications.

  • Obtain the External IP of EMQX cluster

  • Use MQTT X CLI to connect to EMQX cluster

    bash
    $ mqttx conn -h ${external_ip} -p 1883
    
    [4/17/2023] [5:17:31 PM] › … Connecting...
    [4/17/2023] [5:17:31 PM] › ✔ Connected
  • Use the command line to view EMQX cluster log information

    bash
    $ kubectl logs emqx-core-0 -c emqx

    You can get a print similar to the following, which means that EMQX has received a CONNECT message from the client and replied a CONNACK message to the client:

    bash
    2023-04-17T09:11:35.993031+00:00 [debug] msg: mqtt_packet_received, mfa: emqx_channel:handle_in/2, line: 360, peername: 218.190.230.144:59457, clientid: mqttx_322680d9, packet: CONNECT(Q0, R0, D0, ClientId=mqttx_322680d9, ProtoName=MQTT, ProtoVsn=5, CleanStart=true, KeepAlive=30, Username=undefined, Password=), tag: MQTT
    2023-04-17T09:11:35.997066+00:00 [debug] msg: mqtt_packet_sent, mfa: emqx_connection:serialize_and_inc_stats_fun/1, line: 872, peername: 218.190.230.144:59457, clientid: mqttx_322680d9, packet: CONNACK(Q0, R0, D0, AckFlags=0, ReasonCode=0), tag: MQTT