Here’s some gathered info on logs, so we can resume it to incorporate any useful part to the howto.
Logs and debugging
Described options go into the settings section of config.json
file.
Mesh Errors: it is related to the “Show server error log” on MeshCentral admin page:
"MeshErrorLogPath": "/opt/meshcentral/meshcentral-data/mesherrors.txt"
Log and Debug options log MeshCentral events from nodejs (more suited for debugging), offering a custom set of verbosity through the assigned values:
"Log": "main,web,webrequest,cert"
- Target log is
/opt/meshcentral/meshcentral-data/log.txt
"Debug": "main,web,webrequest,cert"
- Debug option targets syslog (
/var/log/messages
and journalctl).
add “?trace=1” at the end of the web application URL and open the browser debug console. You will see all the WebSocket control traffic.
Another option is to use the Trace bar on MeshCentral interface.
Authentication events (could be redundant if using syslogauth
option):
"AuthLog": "/opt/meshcentral/meshcentral-data/auth.log"
Syslog support. Each option can be enabled individually. Destination log is /var/log/messages
:
"syslog": "meshcentral",
"syslogjson": "meshcentral-json",
"syslogauth": "meshcentral-auth"
The assigned values represent the name identifier that will be sent to syslog, they can be customized. Values can also be set to true
:
"syslog": true,
"syslogjson": true,
"syslogauth": true
- syslog: more human readable, you just get the message string
- syslogjson: seems to override syslog option and offers a more detailed information (message string + data in json format)
- syslogauth: authentication events
As in the howto we run MeshCentral with a restricted user, enabling syslog options cause an error:
node: ERROR: Unable to install required module “modern-syslog”. MeshCentral may not have access to npm, or npm may not have suffisent rights to load the new module. Try “npm install modern-syslog” to manualy install this module.
Manual install of modern-syslog fails:
npm ERR! modern-syslog@1.2.0 install: node-gyp rebuild
npm ERR! Exit status 1
node-gyp was missing a prerequisite. Solved with:
yum install gcc-c++ # notice it is usually not needed/advisable to have build tools on a production server
systemctl stop meshcentral
cd /opt/meshcentral
scl enable rh-nodejs10 bash
npm install modern-syslog
exit #exit rh-nodejs10 bash session
systemctl start meshcentral