A script to set the lognode levels in Mendix

As of mendix 6, log levels can be configured through the runtime admin port before the actual loglevels exist. This enables you to create a script that will set all the required loglevel at once.

The following is a small python script that set the loglevels for ConnectionBus and ActionManager to trace and debug:

import requests, base64, json, sys

payload = {
    'params': {'nodes' : [
        { 'name':'ConnectionBus', 'level':'TRACE'},
        { 'name':'ActionManager', 'level':'DEBUG'}
        ], 'force':True}
usage = """
usage: python <admin password> [admin port]
When running from the Modeler, admin password can be retrieved using process explorer:
Determine M2EE_ADMIN_PASS for the java childprocess of Modeler.exe

if len(sys.argv) < 2:

url = 'http://localhost:{}/'.format(8090 if len(sys.argv) == 2 else sys.argv[2])
headers = {'X-M2EE-Authentication': base64.b64encode(sys.argv[1].encode('ascii'))}

response =,headers=headers, json=payload)

You can run this script as follows:

λ python 87a32a3e-c6db-4bc8-9fa3-7cd5b108eaec 8090

You can see the result in the set log levels windows in the mendix modeler:

Set log levels window

There are more interesting ways to use the admin port of the Mendix runtime. Another script i use is a linux bash script for monitoring: it prints app statistics in a shell window, similar to vmstat.

printf "%8s|%8s|%8s|%8s|%8s|%8s|%8s|%8s|%8s\n" "Cache" "Transact" "Select" "Delete" "Insert" "Update" "Anon ses" "Named s" "Nmd usr"
while true;
  printf "%8d %8d %8d %8d %8d %8d %8s %8s %8s\n" \
    $(curl -H "Accept: application/json" -H "Content-type: application/json" -H "X-M2EE-Authentication: MTIzNDU2Nzg5MHF3ZXJ0eQ==" -X POST -d "{'action':'runtime_statistics','params':{}}" http://localhost:9000/ 2>/dev/null | \
      ./jq '. | .feedback.cache.total_count,
           ' \
  sleep 5;

This will produce the following output:

$ ./mxstat
   Cache|Transact|  Select|  Delete|  Insert|  Update|Anon ses| Named s| Nmd usr
       2    48685  1496481    85226    24347    33334        0        1        3
       2    48685  1496483    85226    24347    33334        0        1        3
       2    48685  1496484    85226    24347    33334        0        1        3