add debug/log to schema file

Signed-off-by: si458 <simonsmith5521@gmail.com>

si458 committed Sep 30, 2024 at 14:07 UTC 113adb5b851c3616511874d54cbd4c2d66fc16da
3 files changed +9 -2
meshcentral-config-schema.json
+7 -1
@@ -744,9 +744,15 @@
744 "type": "boolean",
745 "default": false
746 },
747 + "debug": {
748 + "type": "string",
749 + "default": null,
750 + "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."
751 + },
752 "log": {
753 "type": "string",
749 - "default": null
754 + "default": null,
755 + "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."
756 },
757 "syslog": {
758 "type": "string",
meshcentral.js
+1 -1
@@ -3846,7 +3846,7 @@ function CreateMeshCentralServer(config, args) {
3846 // Send event to log file
3847 if (obj.config.settings && obj.config.settings.log) {
3848 if (typeof obj.args.log == 'string') { obj.args.log = obj.args.log.split(','); }
3849 - if (obj.args.log.indexOf(source) >= 0) {
3849 + if ((obj.args.log.indexOf(source) >= 0) || (obj.args.log[0] == '*')) {
3850 const d = new Date();
3851 if (obj.xxLogFile == null) {
3852 try {
sample-config-advanced.json
+1
@@ -106,6 +106,7 @@
106 "_runOnServerUpdated": "c:\\tmp\\mcupdate.bat",
107 "_runOnServerError": "c:\\tmp\\mcerror.bat",
108 "_log": "main,web,webrequest,cert",
109 + "_debug": "main,web,webrequest,cert",
110 "_syslog": "meshcentral",
111 "_syslogauth": "meshcentral-auth",
112 "_syslogjson": "meshcentral-json",