Repository: nats-io/nats-server (go)

Issue:
$SYS.ACCOUNT.<id>.LEAFNODE.CONNECT event is missing
## Defect

Make sure that these boxes are checked before submitting your issue -- thank you!

 - [X] Included `nats-server -DV` output
 - [X] Included a [Minimal, Complete, and Verifiable example] (https://stackoverflow.com/help/mcve)

#### Versions of `nats-server` and affected client libraries used:

nats-server v2.2.6

The log for a quick overview of the config:

```
[1] 2021/06/18 09:45:20.037579 [INF] Starting nats-server
[1] 2021/06/18 09:45:20.037625 [INF]   Version:  2.2.6
[1] 2021/06/18 09:45:20.037629 [INF]   Git:      [cf433ae]
[1] 2021/06/18 09:45:20.037636 [DBG]   Go build: go1.16.4
[1] 2021/06/18 09:45:20.037639 [INF]   Name:     connect-server
[1] 2021/06/18 09:45:20.037650 [INF]   Node:     oD1ds9eQ
[1] 2021/06/18 09:45:20.037656 [INF]   ID:       NCFSASLGS2OLS5LVTBZIHO7OBYUHNPDU3GQKYFX6SV4FAAKQ4Y767OMT
[1] 2021/06/18 09:45:20.037672 [INF] Using configuration file: /nats/config/nats-server.conf
[1] 2021/06/18 09:45:20.037677 [INF] Trusted Operators
[1] 2021/06/18 09:45:20.037682 [INF]   System  : ""
[1] 2021/06/18 09:45:20.037688 [INF]   Operator: "operator"
[1] 2021/06/18 09:45:20.037707 [INF]   Issued  : 2021-05-31 16:23:38 +0000 UTC
[1] 2021/06/18 09:45:20.037719 [INF]   Expires : 1970-01-01 00:00:00 +0000 UTC
[1] 2021/06/18 09:45:20.039075 [INF] Managing all jwt in exclusive directory /nats/accounts
[1] 2021/06/18 09:45:20.039120 [INF] Starting JetStream
[1] 2021/06/18 09:45:20.039287 [DBG] JetStream creating dynamic configuration - 5.84 GB memory, 56.38 GB disk
[1] 2021/06/18 09:45:20.040041 [INF]     _ ___ _____ ___ _____ ___ ___   _   __  __
[1] 2021/06/18 09:45:20.040060 [INF]  _ | | __|_   _/ __|_   _| _ \ __| /_\ |  \/  |
[1] 2021/06/18 09:45:20.040068 [INF] | || | _|  | | \__ \ | | |   / _| / _ \| |\/| |
[1] 2021/06/18 09:45:20.040077 [INF]  \__/|___| |_| |___/ |_| |_|_\___/_/ \_\_|  |_|
[1] 2021/06/18 09:45:20.040085 [INF] 
[1] 2021/06/18 09:45:20.040093 [INF]          https://docs.nats.io/jetstream
[1] 2021/06/18 09:45:20.040102 [INF] 
[1] 2021/06/18 09:45:20.040110 [INF] ---------------- JETSTREAM ----------------
[1] 2021/06/18 09:45:20.040124 [INF]   Max Memory:      5.84 GB
[1] 2021/06/18 09:45:20.040138 [INF]   Max Storage:     56.38 GB
[1] 2021/06/18 09:45:20.040146 [INF]   Store Directory: "nats/jetstream"
[1] 2021/06/18 09:45:20.040153 [INF] -------------------------------------------
[1] 2021/06/18 09:45:20.040254 [DBG]   Exports:
[1] 2021/06/18 09:45:20.040268 [DBG]      $JS.API.>
[1] 2021/06/18 09:45:20.040600 [INF] Starting http monitor on 0.0.0.0:8222
[1] 2021/06/18 09:45:20.040664 [INF] Listening for websocket clients on ws://0.0.0.0:4443
[1] 2021/06/18 09:45:20.040673 [WRN] Websocket not configured with TLS. DO NOT USE IN PRODUCTION!
[1] 2021/06/18 09:45:20.040679 [DBG] Get non local IPs for "0.0.0.0"
[1] 2021/06/18 09:45:20.040818 [DBG]   ip=10.200.0.3
[1] 2021/06/18 09:45:20.040866 [INF] Listening for leafnode connections on 0.0.0.0:7422
[1] 2021/06/18 09:45:20.040877 [DBG] Get non local IPs for "0.0.0.0"
[1] 2021/06/18 09:45:20.040984 [DBG]   ip=10.200.0.3
[1] 2021/06/18 09:45:20.041167 [INF] Listening for MQTT clients on mqtt://0.0.0.0:1883
[1] 2021/06/18 09:45:20.041195 [INF] Listening for client connections on 0.0.0.0:4222
[1] 2021/06/18 09:45:20.041203 [DBG] Get non local IPs for "0.0.0.0"
[1] 2021/06/18 09:45:20.041331 [DBG]   ip=10.200.0.3
[1] 2021/06/18 09:45:20.041348 [INF] Server is ready
[1] 2021/06/18 09:45:20.342093 [INF] 192.168.1.152:42190 - lid:4 - Leafnode connection created
[1] 2021/06/18 09:45:20.360723 [TRC] 192.168.1.152:42190 - lid:4 - <<- [CONNECT {"jwt":"XXX","sig":"XXX","tls_required":false,"server_id":"NBG5EVDFX3ZP7NP5J7OWBF4LBKXMVLPKHR4OKSFZ7YPWFUAWB7UFLYXY","name":"XXX","cluster":"XXX","headers":true}]
```

#### OS/Container environment:

Official nats docker image

#### Steps or code to reproduce the issue:

1. Start a primary nats server with accounts (using full nats resolver) and leafnode enabled
2. Subscribe to $SYS.> with nats cli tools
3. Connect a secondary server and connect it to the primary as a leaf node

#### Expected result:

I would expect the following events to be received by the subscriber:

$SYS.ACCOUNT.\<id>.LEAFNODE.CONNECT
$SYS.SERVER.ACCOUNT.\<id>.CONNS (connections for an account changed) (deprecated)
$SYS.ACCOUNT.\<id>.SERVER.CONNS (Sent when an accounts connections change)
$SYS.ACCOUNT.\<id>.CONNECT (Sent when client connected)

#### Actual result:

Only these ones are received:

$SYS.SERVER.ACCOUNT.\<id>.CONNS (connections for an account changed) (deprecated)
$SYS.ACCOUNT.\<id>.SERVER.CONNS (Sent when an accounts connections change)
$SYS.ACCOUNT.\<id>.CONNECT (Sent when client connected)

Please let me know if you cannot reproduce and I'll try to give more data.

Pull request:
[adding] kind and client_type to account connect/disconnect events
Kind is Client/Leafnode but can take the value of Router/Gateway/JetStream/Account/System in the future.
When kind is Client, then client_type is set to mqtt/websocket/nats
This fixes #2291

Signed-off-by: Matthias Hanel <mh@synadia.com>

I also did a small refactoring to help with naming. type and kind where used in a mixed way.

connect/disconnect for started/killed leafnode.
```
> nats --context=sys sub '$SYS.ACCOUNT.>'
14:48:16 Subscribing on $SYS.ACCOUNT.>
[#1] Received on "$SYS.ACCOUNT.AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G.SERVER.CONNS"
{"type":"io.nats.server.advisory.v1.account_connections","id":"g5SD2PbNko4bO9PUcbxSvl","timestamp":"2021-07-07T18:48:26.327085Z","server":{"name":"srv-4222","host":"localhost","id":"NB7LOXQAEDQDAYV25OR3VJALLSPUTJK36KEJEDKMXYRJAZCEUXZULUHV","cluster":"cluster-hub","ver":"2.3.2-beta.1","seq":22,"jetstream":true,"time":"2021-07-07T18:48:26.327132Z"},"acc":"AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G","conns":0,"leafnodes":1,"total_conns":1}

[#2] Received on "$SYS.ACCOUNT.AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G.CONNECT"
{"type":"io.nats.server.advisory.v1.client_connect","id":"g5SD2PbNko4bO9PUcbxSx0","timestamp":"2021-07-07T18:48:26.327101Z","server":{"name":"srv-4222","host":"localhost","id":"NB7LOXQAEDQDAYV25OR3VJALLSPUTJK36KEJEDKMXYRJAZCEUXZULUHV","cluster":"cluster-hub","ver":"2.3.2-beta.1","seq":23,"jetstream":true,"time":"2021-07-07T18:48:26.327143Z"},"client":{"start":"2021-07-07T18:48:26.325393Z","host":"127.0.0.1","id":7,"acc":"AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G","user":"UATTSBO5CYOSUJZMZ23F345GUOQFWA5WFC5S2E2QGTKRLR76BJTENNDZ","name":"srv-4242","jwt":"eyJ0eXAiOiJKV1QiLCJhbGciOiJlZDI1NTE5LW5rZXkifQ.eyJqdGkiOiJDS1JJN0hTTUw1SlJYQVZXVFVKN1dMQ0ROWDdaTzZWUEtZNjZYWDMyTkwyU0ZKU05MNEhRIiwiaWF0IjoxNjI0NDc5NTQ0LCJpc3MiOiJBQTVDNTZGQUVUQlRVQ1lNN05DNUJGQllGVEtMT0FCSU9JRlBRREhPNFJVRUFQU04zRlRZNVI0RyIsIm5hbWUiOiJsZWFmIiwic3ViIjoiVUFUVFNCTzVDWU9TVUpaTVoyM0YzNDVHVU9RRldBNVdGQzVTMkUyUUdUS1JMUjc2QkpURU5ORFoiLCJuYXRzIjp7InB1YiI6e30sInN1YiI6e30sInN1YnMiOi0xLCJkYXRhIjotMSwicGF5bG9hZCI6LTEsInR5cGUiOiJ1c2VyIiwidmVyc2lvbiI6Mn19.-SbW7JhA5prumxJyQy7rn-YwY5qcjTk2lOC4iI2hyqYR_1qEYfzJ0j9J5vPiY40kBrrB09is_F1tQFpW_8InDw","issuer_key":"AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G","name_tag":"leaf","kind":"Leafnode"}}

[#3] Received on "$SYS.ACCOUNT.ADECCNBUEBWZ727OMBFSN7OMK2FPYRM52TJS25TFQWYS76NPOJBN3KU4.SERVER.CONNS"
 x+                                                                                                                                     buffers
{"type":"io.nats.server.advisory.v1.account_connections","id":"g5SD2PbNko4bO9PUcbxSyF","timestamp":"2021-07-07T18:48:27.327992Z","server":{"name":"srv-4222","host":"localhost","id":"NB7LOXQAEDQDAYV25OR3VJALLSPUTJK36KEJEDKMXYRJAZCEUXZULUHV","cluster":"cluster-hub","ver":"2.3.2-beta.1","seq":25,"jetstream":true,"time":"2021-07-07T18:48:27.32806Z"},"acc":"ADECCNBUEBWZ727OMBFSN7OMK2FPYRM52TJS25TFQWYS76NPOJBN3KU4","conns":2,"leafnodes":1,"total_conns":3}

[#4] Received on "$SYS.ACCOUNT.ADECCNBUEBWZ727OMBFSN7OMK2FPYRM52TJS25TFQWYS76NPOJBN3KU4.CONNECT"
{"type":"io.nats.server.advisory.v1.client_connect","id":"g5SD2PbNko4bO9PUcbxSzU","timestamp":"2021-07-07T18:48:27.328007Z","server":{"name":"srv-4222","host":"localhost","id":"NB7LOXQAEDQDAYV25OR3VJALLSPUTJK36KEJEDKMXYRJAZCEUXZULUHV","cluster":"cluster-hub","ver":"2.3.2-beta.1","seq":26,"jetstream":true,"time":"2021-07-07T18:48:27.328068Z"},"client":{"start":"2021-07-07T18:48:27.3269Z","host":"127.0.0.1","id":9,"acc":"ADECCNBUEBWZ727OMBFSN7OMK2FPYRM52TJS25TFQWYS76NPOJBN3KU4","user":"UAHN57DQWGLOJYEN7E7IWSH4B75SDIUC6YMQVE3G6C2IPOVQ44G63GTM","name":"srv-4242","jwt":"eyJ0eXAiOiJKV1QiLCJhbGciOiJlZDI1NTE5LW5rZXkifQ.eyJqdGkiOiJSVk1PWExSM0tRNTNNRjJYS0NUVkw0NlpCVFpZT0RUWDdFNDVEWUxOUVpON0pJM05MQTRRIiwiaWF0IjoxNjI0NDc5NDgyLCJpc3MiOiJBQUNZSUNPQVFNUTcyRUhUMzVSN0xWNlZGV01JVldGS1dGRTVQMkpKMlRUNjc0RU83REpUVUhNTSIsIm5hbWUiOiJzeXMiLCJzdWIiOiJVQUhONTdEUVdHTE9KWUVON0U3SVdTSDRCNzVTRElVQzZZTVFWRTNHNkMySVBPVlE0NEc2M0dUTSIsIm5hdHMiOnsicHViIjp7fSwic3ViIjp7fSwic3VicyI6LTEsImRhdGEiOi0xLCJwYXlsb2FkIjotMSwiaXNzdWVyX2FjY291bnQiOiJBREVDQ05CVUVCV1o3MjdPTUJGU043T01LMkZQWVJNNTJUSlMyNVRGUVdZUzc2TlBPSkJOM0tVNCIsInR5cGUiOiJ1c2VyIiwidmVyc2lvbiI6Mn19.CD3eqMOyrRw6cDNoKGisHbLtCCw8D9wxtvNbbz1UcZcPRjf2XBtpd1pbVcartxakADiyQAK5Rhx7-TViTie4Dw","issuer_key":"AACYICOAQMQ72EHT35R7LV6VFWMIVWFKWFE5P2JJ2TT674EO7DJTUHMM","name_tag":"sys","kind":"Leafnode"}}

[#5] Received on "$SYS.ACCOUNT.AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G.SERVER.CONNS"
{"type":"io.nats.server.advisory.v1.account_connections","id":"g5SD2PbNko4bO9PUcbxT0j","timestamp":"2021-07-07T18:48:36.448612Z","server":{"name":"srv-4222","host":"localhost","id":"NB7LOXQAEDQDAYV25OR3VJALLSPUTJK36KEJEDKMXYRJAZCEUXZULUHV","cluster":"cluster-hub","ver":"2.3.2-beta.1","seq":29,"jetstream":true,"time":"2021-07-07T18:48:36.448645Z"},"acc":"AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G","conns":0,"leafnodes":0,"total_conns":0}

[#6] Received on "$SYS.ACCOUNT.AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G.DISCONNECT"
{"type":"io.nats.server.advisory.v1.client_disconnect","id":"g5SD2PbNko4bO9PUcbxT1y","timestamp":"2021-07-07T18:48:36.44863Z","server":{"name":"srv-4222","host":"localhost","id":"NB7LOXQAEDQDAYV25OR3VJALLSPUTJK36KEJEDKMXYRJAZCEUXZULUHV","cluster":"cluster-hub","ver":"2.3.2-beta.1","seq":30,"jetstream":true,"time":"2021-07-07T18:48:36.448652Z"},"client":{"start":"2021-07-07T18:48:26.325393Z","host":"127.0.0.1","id":7,"acc":"AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G","user":"UATTSBO5CYOSUJZMZ23F345GUOQFWA5WFC5S2E2QGTKRLR76BJTENNDZ","name":"srv-4242","rtt":127000,"stop":"2021-07-07T18:48:36.44863Z","jwt":"eyJ0eXAiOiJKV1QiLCJhbGciOiJlZDI1NTE5LW5rZXkifQ.eyJqdGkiOiJDS1JJN0hTTUw1SlJYQVZXVFVKN1dMQ0ROWDdaTzZWUEtZNjZYWDMyTkwyU0ZKU05MNEhRIiwiaWF0IjoxNjI0NDc5NTQ0LCJpc3MiOiJBQTVDNTZGQUVUQlRVQ1lNN05DNUJGQllGVEtMT0FCSU9JRlBRREhPNFJVRUFQU04zRlRZNVI0RyIsIm5hbWUiOiJsZWFmIiwic3ViIjoiVUFUVFNCTzVDWU9TVUpaTVoyM0YzNDVHVU9RRldBNVdGQzVTMkUyUUdUS1JMUjc2QkpURU5ORFoiLCJuYXRzIjp7InB1YiI6e30sInN1YiI6e30sInN1YnMiOi0xLCJkYXRhIjotMSwicGF5bG9hZCI6LTEsInR5cGUiOiJ1c2VyIiwidmVyc2lvbiI6Mn19.-SbW7JhA5prumxJyQy7rn-YwY5qcjTk2lOC4iI2hyqYR_1qEYfzJ0j9J5vPiY40kBrr
 x+                                                                                                                                     buffers
B09is_F1tQFpW_8InDw","issuer_key":"AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G","name_tag":"leaf","kind":"Leafnode"},"sent":{"msgs":0,"bytes":0},"received":{"msgs":0,"bytes":0},"reason":"Client Closed"}

[#7] Received on "$SYS.ACCOUNT.ADECCNBUEBWZ727OMBFSN7OMK2FPYRM52TJS25TFQWYS76NPOJBN3KU4.DISCONNECT"
{"type":"io.nats.server.advisory.v1.client_disconnect","id":"g5SD2PbNko4bO9PUcbxT3D","timestamp":"2021-07-07T18:48:36.448708Z","server":{"name":"srv-4222","host":"localhost","id":"NB7LOXQAEDQDAYV25OR3VJALLSPUTJK36KEJEDKMXYRJAZCEUXZULUHV","cluster":"cluster-hub","ver":"2.3.2-beta.1","seq":31,"jetstream":true,"time":"2021-07-07T18:48:36.448755Z"},"client":{"start":"2021-07-07T18:48:27.3269Z","host":"127.0.0.1","id":9,"acc":"ADECCNBUEBWZ727OMBFSN7OMK2FPYRM52TJS25TFQWYS76NPOJBN3KU4","user":"UAHN57DQWGLOJYEN7E7IWSH4B75SDIUC6YMQVE3G6C2IPOVQ44G63GTM","name":"srv-4242","rtt":97000,"stop":"2021-07-07T18:48:36.448708Z","jwt":"eyJ0eXAiOiJKV1QiLCJhbGciOiJlZDI1NTE5LW5rZXkifQ.eyJqdGkiOiJSVk1PWExSM0tRNTNNRjJYS0NUVkw0NlpCVFpZT0RUWDdFNDVEWUxOUVpON0pJM05MQTRRIiwiaWF0IjoxNjI0NDc5NDgyLCJpc3MiOiJBQUNZSUNPQVFNUTcyRUhUMzVSN0xWNlZGV01JVldGS1dGRTVQMkpKMlRUNjc0RU83REpUVUhNTSIsIm5hbWUiOiJzeXMiLCJzdWIiOiJVQUhONTdEUVdHTE9KWUVON0U3SVdTSDRCNzVTRElVQzZZTVFWRTNHNkMySVBPVlE0NEc2M0dUTSIsIm5hdHMiOnsicHViIjp7fSwic3ViIjp7fSwic3VicyI6LTEsImRhdGEiOi0xLCJwYXlsb2FkIjotMSwiaXNzdWVyX2FjY291bnQiOiJBREVDQ05CVUVCV1o3MjdPTUJGU043T01LMkZQWVJNNTJUSlMyNVRGUVdZUzc2TlBPSkJOM0tVNCIsInR5cGUiOiJ1c2VyIiwidmVyc2lvbiI6Mn19.CD3eqMOyrRw6cDNoKGisHbLtCCw8D9wxtvNbbz1UcZcPRjf2XBtpd1pbVcartxakADiyQAK5Rhx7-TViTie4Dw","issuer_key":"AACYICOAQMQ72EHT35R7LV6VFWMIVWFKWFE5P2JJ2TT674EO7DJTUHMM","name_tag":"sys","kind":"Leafnode"},"sent":{"msgs":2,"bytes":892},"received":{"msgs":2,"bytes":1123},"reason":"Client Closed"}

[#8] Received on "$SYS.ACCOUNT.ADECCNBUEBWZ727OMBFSN7OMK2FPYRM52TJS25TFQWYS76NPOJBN3KU4.SERVER.CONNS"
{"type":"io.nats.server.advisory.v1.account_connections","id":"g5SD2PbNko4bO9PUcbxT4S","timestamp":"2021-07-07T18:48:36.44878Z","server":{"name":"srv-4222","host":"localhost","id":"NB7LOXQAEDQDAYV25OR3VJALLSPUTJK36KEJEDKMXYRJAZCEUXZULUHV","cluster":"cluster-hub","ver":"2.3.2-beta.1","seq":33,"jetstream":true,"time":"2021-07-07T18:48:36.448794Z"},"acc":"ADECCNBUEBWZ727OMBFSN7OMK2FPYRM52TJS25TFQWYS76NPOJBN3KU4","conns":2,"leafnodes":0,"total_conns":2}

^C
```

kind Leafnode
```bash
> json-pretty connect
{
    "client": {
        "acc": "AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G",
        "host": "127.0.0.1",
        "id": 7,
        "issuer_key": "AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G",
        "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJlZDI1NTE5LW5rZXkifQ.eyJqdGkiOiJDS1JJN0hTTUw1SlJYQVZXVFVKN1dMQ0ROWDdaTzZWUEtZNjZYWDMyTkwyU0ZKU05MNEhRIiwiaWF0IjoxNjI0NDc5NTQ0LCJpc3MiOiJBQTVDNTZGQUVUQlRVQ1lNN05DNUJGQllGVEtMT0FCSU9JRlBRREhPNFJVRUFQU04zRlRZNVI0RyIsIm5hbWUiOiJsZWFmIiwic3ViIjoiVUFUVFNCTzVDWU9TVUpaTVoyM0YzNDVHVU9RRldBNVdGQzVTMkUyUUdUS1JMUjc2QkpURU5ORFoiLCJuYXRzIjp7InB1YiI6e30sInN1YiI6e30sInN1YnMiOi0xLCJkYXRhIjotMSwicGF5bG9hZCI6LTEsInR5cGUiOiJ1c2VyIiwidmVyc2lvbiI6Mn19.-SbW7JhA5prumxJyQy7rn-YwY5qcjTk2lOC4iI2hyqYR_1qEYfzJ0j9J5vPiY40kBrrB09is_F1tQFpW_8InDw",
        "kind": "Leafnode",
        "name": "srv-4242",
        "name_tag": "leaf",
        "start": "2021-07-07T18:48:26.325393Z",
        "user": "UATTSBO5CYOSUJZMZ23F345GUOQFWA5WFC5S2E2QGTKRLR76BJTENNDZ"
    },
    "id": "g5SD2PbNko4bO9PUcbxSx0",
    "server": {
        "cluster": "cluster-hub",
        "host": "localhost",
        "id": "NB7LOXQAEDQDAYV25OR3VJALLSPUTJK36KEJEDKMXYRJAZCEUXZULUHV",
        "jetstream": true,
        "name": "srv-4222",
        "seq": 23,
        "time": "2021-07-07T18:48:26.327143Z",
        "ver": "2.3.2-beta.1"
    },
    "timestamp": "2021-07-07T18:48:26.327101Z",
    "type": "io.nats.server.advisory.v1.client_connect"
}
> json-pretty disconnect
{
    "client": {
        "acc": "ADECCNBUEBWZ727OMBFSN7OMK2FPYRM52TJS25TFQWYS76NPOJBN3KU4",
        "host": "127.0.0.1",
        "id": 9,
        "issuer_key": "AACYICOAQMQ72EHT35R7LV6VFWMIVWFKWFE5P2JJ2TT674EO7DJTUHMM",
        "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJlZDI1NTE5LW5rZXkifQ.eyJqdGkiOiJSVk1PWExSM0tRNTNNRjJYS0NUVkw0NlpCVFpZT0RUWDdFNDVEWUxOUVpON0pJM05MQTRRIiwiaWF0IjoxNjI0NDc5NDgyLCJpc3MiOiJBQUNZSUNPQVFNUTcyRUhUMzVSN0xWNlZGV01JVldGS1dGRTVQMkpKMlRUNjc0RU83REpUVUhNTSIsIm5hbWUiOiJzeXMiLCJzdWIiOiJVQUhONTdEUVdHTE9KWUVON0U3SVdTSDRCNzVTRElVQzZZTVFWRTNHNkMySVBPVlE0NEc2M0dUTSIsIm5hdHMiOnsicHViIjp7fSwic3ViIjp7fSwic3VicyI6LTEsImRhdGEiOi0xLCJwYXlsb2FkIjotMSwiaXNzdWVyX2FjY291bnQiOiJBREVDQ05CVUVCV1o3MjdPTUJGU043T01LMkZQWVJNNTJUSlMyNVRGUVdZUzc2TlBPSkJOM0tVNCIsInR5cGUiOiJ1c2VyIiwidmVyc2lvbiI6Mn19.CD3eqMOyrRw6cDNoKGisHbLtCCw8D9wxtvNbbz1UcZcPRjf2XBtpd1pbVcartxakADiyQAK5Rhx7-TViTie4Dw",
        "kind": "Leafnode",
        "name": "srv-4242",
        "name_tag": "sys",
        "rtt": 97000,
        "start": "2021-07-07T18:48:27.3269Z",
        "stop": "2021-07-07T18:48:36.448708Z",
        "user": "UAHN57DQWGLOJYEN7E7IWSH4B75SDIUC6YMQVE3G6C2IPOVQ44G63GTM"
    },
    "id": "g5SD2PbNko4bO9PUcbxT3D",
    "reason": "Client Closed",
    "received": {
        "bytes": 1123,
        "msgs": 2
    },
    "sent": {
        "bytes": 892,
        "msgs": 2
    },
    "server": {
        "cluster": "cluster-hub",
        "host": "localhost",
        "id": "NB7LOXQAEDQDAYV25OR3VJALLSPUTJK36KEJEDKMXYRJAZCEUXZULUHV",
        "jetstream": true,
        "name": "srv-4222",
        "seq": 31,
        "time": "2021-07-07T18:48:36.448755Z",
        "ver": "2.3.2-beta.1"
    },
    "timestamp": "2021-07-07T18:48:36.448708Z",
    "type": "io.nats.server.advisory.v1.client_disconnect"
}
>
```


Connect disconnect events for mqtt client
```bash
[#34] Received on "$SYS.ACCOUNT.AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G.CONNECT"
{"type":"io.nats.server.advisory.v1.client_connect","id":"gS16ho4ZGg4ejyasUrs4ey","timestamp":"2021-07-07T19:20:35.031399Z","server":{"name":"srv-4222","host":"localhost","id":"NBMM7H7WDO3CQML7GTP4WILBFTPBC5TKPBGUVAB6UK5VRT4YBLWMXIIS","cluster":"cluster-hub","ver":"2.3.2-beta.1","seq":47,"jetstream":true,"time":"2021-07-07T19:20:35.031427Z"},"client":{"start":"2021-07-07T19:20:35.030668Z","host":"::1","id":12,"acc":"AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G","user":"mqtt","jwt":"eyJ0eXAiOiJKV1QiLCJhbGciOiJlZDI1NTE5LW5rZXkifQ.eyJqdGkiOiIyNUtEVElCUjVURzRKWVlJUkdGT0k1UDc3R1ZWVjZHNjRGSVpBT05SWFJFNUhENjZDVEVRIiwiaWF0IjoxNjI1Njg1NTczLCJpc3MiOiJBQTVDNTZGQUVUQlRVQ1lNN05DNUJGQllGVEtMT0FCSU9JRlBRREhPNFJVRUFQU04zRlRZNVI0RyIsIm5hbWUiOiJiZWFyZXIiLCJzdWIiOiJVQUZDN09JRU82R09FVkdVRFlVUlRMT0FSVzQ2S09HR0tJUVRPVFA3NVdRMlZJWFNUM1JORENFUiIsIm5hdHMiOnsicHViIjp7fSwic3ViIjp7fSwic3VicyI6LTEsImRhdGEiOi0xLCJwYXlsb2FkIjotMSwiYmVhcmVyX3Rva2VuIjp0cnVlLCJhbGxvd2VkX2Nvbm5lY3Rpb25fdHlwZXMiOlsiTVFUVCJdLCJ0eXBlIjoidXNlciIsInZlcnNpb24iOjJ9fQ.HTB6HiD4mHJVwwKb5SDRC-mevRrVc9oXUtnAiy1bm0rHTMhsIH2z1h0dfOvgQcBEXemHGpafv0_P8oQDNB2yBw","issuer_key":"AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G","name_tag":"bearer","kind":"Client","type":"mqtt"}}

[#36] Received on "$SYS.ACCOUNT.AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G.DISCONNECT"
{"type":"io.nats.server.advisory.v1.client_disconnect","id":"gS16ho4ZGg4ejyasUrs4iA","timestamp":"2021-07-07T19:20:35.033651Z","server":{"name":"srv-4222","host":"localhost","id":"NBMM7H7WDO3CQML7GTP4WILBFTPBC5TKPBGUVAB6UK5VRT4YBLWMXIIS","cluster":"cluster-hub","ver":"2.3.2-beta.1","seq":50,"jetstream":true,"time":"2021-07-07T19:20:35.03366Z"},"client":{"start":"2021-07-07T19:20:35.030668Z","host":"::1","id":12,"acc":"AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G","user":"mqtt","stop":"2021-07-07T19:20:35.033651Z","jwt":"eyJ0eXAiOiJKV1QiLCJhbGciOiJlZDI1NTE5LW5rZXkifQ.eyJqdGkiOiIyNUtEVElCUjVURzRKWVlJUkdGT0k1UDc3R1ZWVjZHNjRGSVpBT05SWFJFNUhENjZDVEVRIiwiaWF0IjoxNjI1Njg1NTczLCJpc3MiOiJBQTVDNTZGQUVUQlRVQ1lNN05DNUJGQllGVEtMT0FCSU9JRlBRREhPNFJVRUFQU04zRlRZNVI0RyIsIm5hbWUiOiJiZWFyZXIiLCJzdWIiOiJVQUZDN09JRU82R09FVkdVRFlVUlRMT0FSVzQ2S09HR0tJUVRPVFA3NVdRMlZJWFNUM1JORENFUiIsIm5hdHMiOnsicHViIjp7fSwic3ViIjp7fSwic3VicyI6LTEsImRhdGEiOi0xLCJwYXlsb2FkIjotMSwiYmVhcmVyX3Rva2VuIjp0cnVlLCJhbGxvd2VkX2Nvbm5lY3Rpb25fdHlwZXMiOlsiTVFUVCJdLCJ0eXBlIjoidXNlciIsInZlcnNpb24iOjJ9fQ.HTB6HiD4mHJVwwKb5SDRC-mevRrVc9oXUtnAiy1bm0rHTMhsIH2z1h0dfOvgQcBEXemHGpafv0_P8oQDNB2yBw","issuer_key":"AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G","name_tag":"bearer","kind":"Client","type":"mqtt"},"sent":{"msgs":0,"bytes":0},"received":{"msgs":0,"bytes":0},"reason":"Protocol Violation"}
```

client type "mqtt"
```
> json-pretty connect
{
    "client": {
        "acc": "AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G",
        "host": "::1",
        "id": 12,
        "issuer_key": "AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G",
        "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJlZDI1NTE5LW5rZXkifQ.eyJqdGkiOiIyNUtEVElCUjVURzRKWVlJUkdGT0k1UDc3R1ZWVjZHNjRGSVpBT05SWFJFNUhENjZDVEVRIiwiaWF0IjoxNjI1Njg1NTczLCJpc3MiOiJBQTVDNTZGQUVUQlRVQ1lNN05DNUJGQllGVEtMT0FCSU9JRlBRREhPNFJVRUFQU04zRlRZNVI0RyIsIm5hbWUiOiJiZWFyZXIiLCJzdWIiOiJVQUZDN09JRU82R09FVkdVRFlVUlRMT0FSVzQ2S09HR0tJUVRPVFA3NVdRMlZJWFNUM1JORENFUiIsIm5hdHMiOnsicHViIjp7fSwic3ViIjp7fSwic3VicyI6LTEsImRhdGEiOi0xLCJwYXlsb2FkIjotMSwiYmVhcmVyX3Rva2VuIjp0cnVlLCJhbGxvd2VkX2Nvbm5lY3Rpb25fdHlwZXMiOlsiTVFUVCJdLCJ0eXBlIjoidXNlciIsInZlcnNpb24iOjJ9fQ.HTB6HiD4mHJVwwKb5SDRC-mevRrVc9oXUtnAiy1bm0rHTMhsIH2z1h0dfOvgQcBEXemHGpafv0_P8oQDNB2yBw",
        "kind": "Client",
        "name_tag": "bearer",
        "start": "2021-07-07T19:20:35.030668Z",
        "client_type": "mqtt",
        "user": "mqtt"
    },
    "id": "gS16ho4ZGg4ejyasUrs4ey",
    "server": {
        "cluster": "cluster-hub",
        "host": "localhost",
        "id": "NBMM7H7WDO3CQML7GTP4WILBFTPBC5TKPBGUVAB6UK5VRT4YBLWMXIIS",
        "jetstream": true,
        "name": "srv-4222",
        "seq": 47,
        "time": "2021-07-07T19:20:35.031427Z",
        "ver": "2.3.2-beta.1"
    },
    "timestamp": "2021-07-07T19:20:35.031399Z",
    "type": "io.nats.server.advisory.v1.client_connect"
}
> json-pretty disconnect
{
    "client": {
        "acc": "AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G",
        "host": "::1",
        "id": 12,
        "issuer_key": "AA5C56FAETBTUCYM7NC5BFBYFTKLOABIOIFPQDHO4RUEAPSN3FTY5R4G",
        "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJlZDI1NTE5LW5rZXkifQ.eyJqdGkiOiIyNUtEVElCUjVURzRKWVlJUkdGT0k1UDc3R1ZWVjZHNjRGSVpBT05SWFJFNUhENjZDVEVRIiwiaWF0IjoxNjI1Njg1NTczLCJpc3MiOiJBQTVDNTZGQUVUQlRVQ1lNN05DNUJGQllGVEtMT0FCSU9JRlBRREhPNFJVRUFQU04zRlRZNVI0RyIsIm5hbWUiOiJiZWFyZXIiLCJzdWIiOiJVQUZDN09JRU82R09FVkdVRFlVUlRMT0FSVzQ2S09HR0tJUVRPVFA3NVdRMlZJWFNUM1JORENFUiIsIm5hdHMiOnsicHViIjp7fSwic3ViIjp7fSwic3VicyI6LTEsImRhdGEiOi0xLCJwYXlsb2FkIjotMSwiYmVhcmVyX3Rva2VuIjp0cnVlLCJhbGxvd2VkX2Nvbm5lY3Rpb25fdHlwZXMiOlsiTVFUVCJdLCJ0eXBlIjoidXNlciIsInZlcnNpb24iOjJ9fQ.HTB6HiD4mHJVwwKb5SDRC-mevRrVc9oXUtnAiy1bm0rHTMhsIH2z1h0dfOvgQcBEXemHGpafv0_P8oQDNB2yBw",
        "kind": "Client",
        "name_tag": "bearer",
        "start": "2021-07-07T19:20:35.030668Z",
        "stop": "2021-07-07T19:20:35.033651Z",
        "client_type": "mqtt",
        "user": "mqtt"
    },
    "id": "gS16ho4ZGg4ejyasUrs4iA",
    "reason": "Protocol Violation",
    "received": {
        "bytes": 0,
        "msgs": 0
    },
    "sent": {
        "bytes": 0,
        "msgs": 0
    },
    "server": {
        "cluster": "cluster-hub",
        "host": "localhost",
        "id": "NBMM7H7WDO3CQML7GTP4WILBFTPBC5TKPBGUVAB6UK5VRT4YBLWMXIIS",
        "jetstream": true,
        "name": "srv-4222",
        "seq": 50,
        "time": "2021-07-07T19:20:35.03366Z",
        "ver": "2.3.2-beta.1"
    },
    "timestamp": "2021-07-07T19:20:35.033651Z",
    "type": "io.nats.server.advisory.v1.client_disconnect"
}
```

Patch:
diff --git a/server/auth.go b/server/auth.go
index b137959b..d6e7fbfe 100644
--- a/server/auth.go
+++ b/server/auth.go
@@ -671,7 +671,7 @@ func (s *Server) processClientOrLeafAuthentication(c *client, opts *Options) boo
 		acc.mu.RLock()
 		c.Debugf("Authenticated JWT: %s %q (claim-name: %q, claim-tags: %q) "+
 			"signed with %q by Account %q (claim-name: %q, claim-tags: %q) signed with %q",
-			c.typeString(), juc.Subject, juc.Name, juc.Tags, juc.Issuer, issuer, acc.nameTag, acc.tags, acc.Issuer)
+			c.kindString(), juc.Subject, juc.Name, juc.Tags, juc.Issuer, issuer, acc.nameTag, acc.tags, acc.Issuer)
 		acc.mu.RUnlock()
 		return true
 	}
diff --git a/server/client.go b/server/client.go
index 4e187ded..d83ae379 100644
--- a/server/client.go
+++ b/server/client.go
@@ -474,6 +474,20 @@ func (c *client) clientType() int {
 	}
 }
 
+var clientTypeStringMap = map[int]string{
+	NON_CLIENT: _EMPTY_,
+	NATS:       "nats",
+	WS:         "websocket",
+	MQTT:       "mqtt",
+}
+
+func (c *client) clientTypeString() string {
+	if typeStringVal, ok := clientTypeStringMap[c.clientType()]; ok {
+		return typeStringVal
+	}
+	return _EMPTY_
+}
+
 // This is the main subscription struct that indicates
 // interest in published messages.
 // FIXME(dlc) - This is getting bloated for normal subs, need
@@ -1493,11 +1507,11 @@ func (c *client) markConnAsClosed(reason ClosedState) {
 	// we use Noticef on create, so use that too for delete.
 	if c.srv != nil {
 		if c.kind == LEAF {
-			c.Noticef("%s connection closed: %s account: %s", c.typeString(), reason, c.acc.traceLabel())
+			c.Noticef("%s connection closed: %s account: %s", c.kindString(), reason, c.acc.traceLabel())
 		} else if c.kind == ROUTER || c.kind == GATEWAY {
-			c.Noticef("%s connection closed: %s", c.typeString(), reason)
+			c.Noticef("%s connection closed: %s", c.kindString(), reason)
 		} else { // Client, System, Jetstream, and Account connections.
-			c.Debugf("%s connection closed: %s", c.typeString(), reason)
+			c.Debugf("%s connection closed: %s", c.kindString(), reason)
 		}
 	}
 
@@ -4331,7 +4345,7 @@ func (c *client) processPingTimer() {
 		return
 	}
 
-	c.Debugf("%s Ping Timer", c.typeString())
+	c.Debugf("%s Ping Timer", c.kindString())
 
 	var sendPing bool
 
@@ -4467,7 +4481,7 @@ func (c *client) flushAndClose(minimalFlush bool) {
 	}
 }
 
-var typeStringMap = map[int]string{
+var kindStringMap = map[int]string{
 	CLIENT:    "Client",
 	ROUTER:    "Router",
 	GATEWAY:   "Gateway",
@@ -4477,11 +4491,10 @@ var typeStringMap = map[int]string{
 	SYSTEM:    "System",
 }
 
-func (c *client) typeString() string {
-	if typeStringVal, ok := typeStringMap[c.kind]; ok {
-		return typeStringVal
+func (c *client) kindString() string {
+	if kindStringVal, ok := kindStringMap[c.kind]; ok {
+		return kindStringVal
 	}
-
 	return "Unknown Type"
 }
 
@@ -4943,6 +4956,8 @@ func (c *client) getClientInfo(detailed bool) *ClientInfo {
 		ci.IssuerKey = issuerForClient(c)
 		ci.NameTag = c.nameTag
 		ci.Tags = c.tags
+		ci.Kind = c.kindString()
+		ci.ClientType = c.clientTypeString()
 	}
 	c.mu.Unlock()
 	return &ci
diff --git a/server/events.go b/server/events.go
index 172fa21c..a3742fe4 100644
--- a/server/events.go
+++ b/server/events.go
@@ -53,8 +53,8 @@ const (
 	serverStatsSubj          = "$SYS.SERVER.%s.STATSZ"
 	serverDirectReqSubj      = "$SYS.REQ.SERVER.%s.%s"
 	serverPingReqSubj        = "$SYS.REQ.SERVER.PING.%s"
-	serverStatsPingReqSubj   = "$SYS.REQ.SERVER.PING" // use $SYS.REQ.SERVER.PING.STATSZ instead
-	leafNodeConnectEventSubj = "$SYS.ACCOUNT.%s.LEAFNODE.CONNECT"
+	serverStatsPingReqSubj   = "$SYS.REQ.SERVER.PING"             // use $SYS.REQ.SERVER.PING.STATSZ instead
+	leafNodeConnectEventSubj = "$SYS.ACCOUNT.%s.LEAFNODE.CONNECT" // for internal use only
 	remoteLatencyEventSubj   = "$SYS.LATENCY.M2.%s"
 	inboxRespSubj            = "$SYS._INBOX.%s.%s"
 
@@ -165,23 +165,25 @@ type ServerInfo struct {
 
 // ClientInfo is detailed information about the client forming a connection.
 type ClientInfo struct {
-	Start     *time.Time    `json:"start,omitempty"`
-	Host      string        `json:"host,omitempty"`
-	ID        uint64        `json:"id,omitempty"`
-	Account   string        `json:"acc"`
-	Service   string        `json:"svc,omitempty"`
-	User      string        `json:"user,omitempty"`
-	Name      string        `json:"name,omitempty"`
-	Lang      string        `json:"lang,omitempty"`
-	Version   string        `json:"ver,omitempty"`
-	RTT       time.Duration `json:"rtt,omitempty"`
-	Server    string        `json:"server,omitempty"`
-	Cluster   string        `json:"cluster,omitempty"`
-	Stop      *time.Time    `json:"stop,omitempty"`
-	Jwt       string        `json:"jwt,omitempty"`
-	IssuerKey string        `json:"issuer_key,omitempty"`
-	NameTag   string        `json:"name_tag,omitempty"`
-	Tags      jwt.TagList   `json:"tags,omitempty"`
+	Start      *time.Time    `json:"start,omitempty"`
+	Host       string        `json:"host,omitempty"`
+	ID         uint64        `json:"id,omitempty"`
+	Account    string        `json:"acc"`
+	Service    string        `json:"svc,omitempty"`
+	User       string        `json:"user,omitempty"`
+	Name       string        `json:"name,omitempty"`
+	Lang       string        `json:"lang,omitempty"`
+	Version    string        `json:"ver,omitempty"`
+	RTT        time.Duration `json:"rtt,omitempty"`
+	Server     string        `json:"server,omitempty"`
+	Cluster    string        `json:"cluster,omitempty"`
+	Stop       *time.Time    `json:"stop,omitempty"`
+	Jwt        string        `json:"jwt,omitempty"`
+	IssuerKey  string        `json:"issuer_key,omitempty"`
+	NameTag    string        `json:"name_tag,omitempty"`
+	Tags       jwt.TagList   `json:"tags,omitempty"`
+	Kind       string        `json:"kind,omitempty"`
+	ClientType string        `json:"client_type,omitempty"`
 }
 
 // ServerStats hold various statistics that we will periodically send out.
@@ -1440,18 +1442,20 @@ func (s *Server) accountConnectEvent(c *client) {
 			Time: time.Now().UTC(),
 		},
 		Client: ClientInfo{
-			Start:     &c.start,
-			Host:      c.host,
-			ID:        c.cid,
-			Account:   accForClient(c),
-			User:      c.getRawAuthUser(),
-			Name:      c.opts.Name,
-			Lang:      c.opts.Lang,
-			Version:   c.opts.Version,
-			Jwt:       c.opts.JWT,
-			IssuerKey: issuerForClient(c),
-			Tags:      c.tags,
-			NameTag:   c.nameTag,
+			Start:      &c.start,
+			Host:       c.host,
+			ID:         c.cid,
+			Account:    accForClient(c),
+			User:       c.getRawAuthUser(),
+			Name:       c.opts.Name,
+			Lang:       c.opts.Lang,
+			Version:    c.opts.Version,
+			Jwt:        c.opts.JWT,
+			IssuerKey:  issuerForClient(c),
+			Tags:       c.tags,
+			NameTag:    c.nameTag,
+			Kind:       c.kindString(),
+			ClientType: c.clientTypeString(),
 		},
 	}
 	c.mu.Unlock()
@@ -1487,20 +1491,22 @@ func (s *Server) accountDisconnectEvent(c *client, now time.Time, reason string)
 			Time: now,
 		},
 		Client: ClientInfo{
-			Start:     &c.start,
-			Stop:      &now,
-			Host:      c.host,
-			ID:        c.cid,
-			Account:   accForClient(c),
-			User:      c.getRawAuthUser(),
-			Name:      c.opts.Name,
-			Lang:      c.opts.Lang,
-			Version:   c.opts.Version,
-			RTT:       c.getRTT(),
-			Jwt:       c.opts.JWT,
-			IssuerKey: issuerForClient(c),
-			Tags:      c.tags,
-			NameTag:   c.nameTag,
+			Start:      &c.start,
+			Stop:       &now,
+			Host:       c.host,
+			ID:         c.cid,
+			Account:    accForClient(c),
+			User:       c.getRawAuthUser(),
+			Name:       c.opts.Name,
+			Lang:       c.opts.Lang,
+			Version:    c.opts.Version,
+			RTT:        c.getRTT(),
+			Jwt:        c.opts.JWT,
+			IssuerKey:  issuerForClient(c),
+			Tags:       c.tags,
+			NameTag:    c.nameTag,
+			Kind:       c.kindString(),
+			ClientType: c.clientTypeString(),
 		},
 		Sent: DataStats{
 			Msgs:  atomic.LoadInt64(&c.inMsgs),
@@ -1536,20 +1542,22 @@ func (s *Server) sendAuthErrorEvent(c *client) {
 			Time: now,
 		},
 		Client: ClientInfo{
-			Start:     &c.start,
-			Stop:      &now,
-			Host:      c.host,
-			ID:        c.cid,
-			Account:   accForClient(c),
-			User:      c.getRawAuthUser(),
-			Name:      c.opts.Name,
-			Lang:      c.opts.Lang,
-			Version:   c.opts.Version,
-			RTT:       c.getRTT(),
-			Jwt:       c.opts.JWT,
-			IssuerKey: issuerForClient(c),
-			Tags:      c.tags,
-			NameTag:   c.nameTag,
+			Start:      &c.start,
+			Stop:       &now,
+			Host:       c.host,
+			ID:         c.cid,
+			Account:    accForClient(c),
+			User:       c.getRawAuthUser(),
+			Name:       c.opts.Name,
+			Lang:       c.opts.Lang,
+			Version:    c.opts.Version,
+			RTT:        c.getRTT(),
+			Jwt:        c.opts.JWT,
+			IssuerKey:  issuerForClient(c),
+			Tags:       c.tags,
+			NameTag:    c.nameTag,
+			Kind:       c.kindString(),
+			ClientType: c.clientTypeString(),
 		},
 		Sent: DataStats{
 			Msgs:  c.inMsgs,
diff --git a/server/ocsp.go b/server/ocsp.go
index 59771f93..ca49fe7f 100644
--- a/server/ocsp.go
+++ b/server/ocsp.go
@@ -317,7 +317,7 @@ func (srv *Server) NewOCSPMonitor(config *tlsConfigKind) (*tls.Config, *OCSPMoni
 		certFile string
 		caFile   string
 	)
-	if kind == typeStringMap[CLIENT] {
+	if kind == kindStringMap[CLIENT] {
 		tcOpts = opts.tlsConfigOpts
 		if opts.TLSCert != _EMPTY_ {
 			certFile = opts.TLSCert
@@ -412,7 +412,7 @@ func (srv *Server) NewOCSPMonitor(config *tlsConfigKind) (*tls.Config, *OCSPMoni
 
 		// Check whether need to verify staples from a client connection depending on the type.
 		switch kind {
-		case typeStringMap[ROUTER], typeStringMap[GATEWAY], typeStringMap[LEAF]:
+		case kindStringMap[ROUTER], kindStringMap[GATEWAY], kindStringMap[LEAF]:
 			tc.VerifyConnection = func(s tls.ConnectionState) error {
 				oresp := s.OCSPResponse
 				if oresp == nil {
@@ -491,7 +491,7 @@ func (s *Server) configureOCSP() []*tlsConfigKind {
 	if config := sopts.TLSConfig; config != nil {
 		opts := sopts.tlsConfigOpts
 		o := &tlsConfigKind{
-			kind:      typeStringMap[CLIENT],
+			kind:      kindStringMap[CLIENT],
 			tlsConfig: config,
 			tlsOpts:   opts,
 			apply:     func(tc *tls.Config) { sopts.TLSConfig = tc },
@@ -501,7 +501,7 @@ func (s *Server) configureOCSP() []*tlsConfigKind {
 	if config := sopts.Cluster.TLSConfig; config != nil {
 		opts := sopts.Cluster.tlsConfigOpts
 		o := &tlsConfigKind{
-			kind:      typeStringMap[ROUTER],
+			kind:      kindStringMap[ROUTER],
 			tlsConfig: config,
 			tlsOpts:   opts,
 			apply:     func(tc *tls.Config) { sopts.Cluster.TLSConfig = tc },
@@ -511,7 +511,7 @@ func (s *Server) configureOCSP() []*tlsConfigKind {
 	if config := sopts.LeafNode.TLSConfig; config != nil {
 		opts := sopts.LeafNode.tlsConfigOpts
 		o := &tlsConfigKind{
-			kind:      typeStringMap[LEAF],
+			kind:      kindStringMap[LEAF],
 			tlsConfig: config,
 			tlsOpts:   opts,
 			apply: func(tc *tls.Config) {
@@ -531,7 +531,7 @@ func (s *Server) configureOCSP() []*tlsConfigKind {
 		opts := remote.tlsConfigOpts
 		if config := remote.TLSConfig; config != nil {
 			o := &tlsConfigKind{
-				kind:      typeStringMap[LEAF],
+				kind:      kindStringMap[LEAF],
 				tlsConfig: config,
 				tlsOpts:   opts,
 				apply: func(tc *tls.Config) {
@@ -548,7 +548,7 @@ func (s *Server) configureOCSP() []*tlsConfigKind {
 	if config := sopts.Gateway.TLSConfig; config != nil {
 		opts := sopts.Gateway.tlsConfigOpts
 		o := &tlsConfigKind{
-			kind:      typeStringMap[GATEWAY],
+			kind:      kindStringMap[GATEWAY],
 			tlsConfig: config,
 			tlsOpts:   opts,
 			apply:     func(tc *tls.Config) { sopts.Gateway.TLSConfig = tc },
@@ -559,7 +559,7 @@ func (s *Server) configureOCSP() []*tlsConfigKind {
 		opts := remote.tlsConfigOpts
 		if config := remote.TLSConfig; config != nil {
 			o := &tlsConfigKind{
-				kind:      typeStringMap[GATEWAY],
+				kind:      kindStringMap[GATEWAY],
 				tlsConfig: config,
 				tlsOpts:   opts,
 				apply: func(tc *tls.Config) {
diff --git a/server/parser.go b/server/parser.go
index b7dd7634..a9c3533a 100644
--- a/server/parser.go
+++ b/server/parser.go
@@ -1190,7 +1190,7 @@ authErr:
 parseErr:
 	c.sendErr("Unknown Protocol Operation")
 	snip := protoSnippet(i, PROTO_SNIPPET_SIZE, buf)
-	err := fmt.Errorf("%s parser ERROR, state=%d, i=%d: proto='%s...'", c.typeString(), c.state, i, snip)
+	err := fmt.Errorf("%s parser ERROR, state=%d, i=%d: proto='%s...'", c.kindString(), c.state, i, snip)
 	return err
 }
 


Test patch:
diff --git a/server/client_test.go b/server/client_test.go
index 155ac91d..2d3f8acb 100644
--- a/server/client_test.go
+++ b/server/client_test.go
@@ -893,7 +893,7 @@ func TestTypeString(t *testing.T) {
 	}
 	for _, cs := range cases {
 		c := &client{kind: cs.intType}
-		typeStringVal := c.typeString()
+		typeStringVal := c.kindString()
 
 		if typeStringVal != cs.stringType {
 			t.Fatalf("Expected typeString  value  %q, but instead received %q", cs.stringType, typeStringVal)