add settings
This commit is contained in:
parent
706014430c
commit
ab50d4d60e
@ -51,7 +51,7 @@ const serverHealth = () => {
|
||||
user: formatMemoryUsage(cpuData.user),
|
||||
}
|
||||
|
||||
Logger.info('Server health', {memoryUsage, cpuUsage});
|
||||
Logger.info('Server health ', {memoryUsage, cpuUsage});
|
||||
};
|
||||
|
||||
Meteor.startup(() => {
|
||||
@ -61,9 +61,15 @@ Meteor.startup(() => {
|
||||
|
||||
Logger.warn(`Started bbb-html5 process with instanceId=${instanceId}`);
|
||||
|
||||
const LOG_CONFIG = Meteor.settings.private.serverLog;
|
||||
const { healthChecker } = LOG_CONFIG;
|
||||
const { enable: enableHealthCheck, intervalMs: healthCheckInterval } = healthChecker;
|
||||
|
||||
if (enableHealthCheck) {
|
||||
Meteor.setInterval(() => {
|
||||
serverHealth();
|
||||
}, 30000);
|
||||
}, healthCheckInterval);
|
||||
}
|
||||
|
||||
const { customHeartbeat } = APP_CONFIG;
|
||||
|
||||
|
@ -3,15 +3,15 @@ import { createLogger, format, transports } from 'winston';
|
||||
import WinstonPromTransport from './prom-metrics/winstonPromTransport';
|
||||
|
||||
const LOG_CONFIG = Meteor?.settings?.private?.serverLog || {};
|
||||
const { level } = LOG_CONFIG;
|
||||
const { level, includeServerInfo } = LOG_CONFIG;
|
||||
|
||||
const serverInfoFormat = format.printf(({ level, message, timestamp, ...metadata}) => {
|
||||
const instanceId = parseInt(process.env.INSTANCE_ID, 10);
|
||||
const serverInfoFormat = format.printf(({ level, message, timestamp, ...metadata }) => {
|
||||
const instanceId = parseInt(process.env.INSTANCE_ID, 10) || 1;
|
||||
const role = process.env.BBB_HTML5_ROLE;
|
||||
const server = Meteor?.isDevelopment ? 'development' : `${role}-${instanceId}`;
|
||||
const server = includeServerInfo && !Meteor?.isDevelopment ? `${role}-${instanceId} ` : "";
|
||||
|
||||
let msg = `${timestamp} ${server} [${level}] : ${message}`;
|
||||
if(metadata) msg += JSON.stringify(metadata)
|
||||
let msg = `${timestamp} ${server}[${level}] : ${message}`;
|
||||
if (metadata) msg += JSON.stringify(metadata)
|
||||
return msg
|
||||
});
|
||||
|
||||
|
@ -858,6 +858,10 @@ private:
|
||||
serverLog:
|
||||
level: info
|
||||
streamerLog: false
|
||||
includeServerInfo: true
|
||||
healthChecker:
|
||||
enable: true
|
||||
intervalMs: 30000
|
||||
minBrowserVersions:
|
||||
- browser: chrome
|
||||
version: 72
|
||||
|
Loading…
Reference in New Issue
Block a user