From 2f34b7e83bdffece29c70b94135a27068615f069 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 15 Sep 2024 09:40:36 -0700 Subject: [PATCH] Improved debug documentation. --- docs/docs/meshcentral/debugging.md | 43 ++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/docs/docs/meshcentral/debugging.md b/docs/docs/meshcentral/debugging.md index 839cfc4088..68a3725e00 100644 --- a/docs/docs/meshcentral/debugging.md +++ b/docs/docs/meshcentral/debugging.md @@ -92,14 +92,53 @@ In general the problem is that you are running two MeshCentral instances at the ### Running Meshcentral server in debug mode +Debug more will cause MeshCentral to output a lot of debug messages to the console. To display all debug messages, run MeshCentral like this: + ```bash node node_modules/meshcentral --debug ``` -### Enabling trace in your browser Dev Tools +A more practical way to run the debug command it to specify what messages you want printed out using a comma seperated list, for example: + +```bash +node node_modules/meshcentral --debug web,amt,mps +``` + +Here is the list of all debug options: + +``` +cookie - Cookie encoder +dispatch - Message Dispatcher +main - Main Server Messages +peer - MeshCentral Server Peering +agent - MeshAgent traffic +agentupdate - MeshAgent update +cert - Server Certificate +db - Server Database +email - Email/SMS/Push Traffic +web - Web Server +webrequest - Web Server Requests +relay - Web Socket Relay +httpheaders - Web Server HTTP Headers +authlog - User Authentication Log +amt - Intel AMT +webrelay - Connection Relay +mps - CIRA Server +mpscmd - CIRA Server Commands +``` + +You can also specify the `debug` option in the config.json file in the `settings` section. For example: + +``` +"settings": { + "debug": "web,amt,mps" +} +``` -`Trace=1` as a parameter in chrome dev tools for debugging +### Enabling trace in your browser Dev Tools + +You can enable browser console tracing by adding `trace=1` as a parameter to the URL of the MeshCentral main web page. For example `https://myserver.com/?trace=1`. Once present, open the browser's console window to see all web client tracing messages. To log all database queries, change log_statement in /etc/postgresql/13/main/postgresql.conf