From 113adb5b851c3616511874d54cbd4c2d66fc16da Mon Sep 17 00:00:00 2001 From: si458 Date: Mon, 30 Sep 2024 14:07:34 +0100 Subject: [PATCH] add debug/log to schema file Signed-off-by: si458 --- meshcentral-config-schema.json | 8 +++++++- meshcentral.js | 2 +- sample-config-advanced.json | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index 5d72a227..29b20b54 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -744,9 +744,15 @@ "type": "boolean", "default": false }, + "debug": { + "type": "string", + "default": null, + "description": "You can set this value in the format 'web,agent,relay', where each value is separated by a comma. Each specified value will output logs to the MeshCentral console. Setting it to '*' will output all logs." + }, "log": { "type": "string", - "default": null + "default": null, + "description": "You can set this value in the format 'web,agent,relay', where each value is separated by a comma. Each specified value will output logs to a file named 'log.txt' located inside the 'meshcentral-data' folder. Setting it to '*' will output all logs." }, "syslog": { "type": "string", diff --git a/meshcentral.js b/meshcentral.js index 2434a8c3..0162b608 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -3846,7 +3846,7 @@ function CreateMeshCentralServer(config, args) { // Send event to log file if (obj.config.settings && obj.config.settings.log) { if (typeof obj.args.log == 'string') { obj.args.log = obj.args.log.split(','); } - if (obj.args.log.indexOf(source) >= 0) { + if ((obj.args.log.indexOf(source) >= 0) || (obj.args.log[0] == '*')) { const d = new Date(); if (obj.xxLogFile == null) { try { diff --git a/sample-config-advanced.json b/sample-config-advanced.json index e462047b..c744f7ff 100644 --- a/sample-config-advanced.json +++ b/sample-config-advanced.json @@ -106,6 +106,7 @@ "_runOnServerUpdated": "c:\\tmp\\mcupdate.bat", "_runOnServerError": "c:\\tmp\\mcerror.bat", "_log": "main,web,webrequest,cert", + "_debug": "main,web,webrequest,cert", "_syslog": "meshcentral", "_syslogauth": "meshcentral-auth", "_syslogjson": "meshcentral-json",