add settings

This commit is contained in:
Ramón Souza 2022-09-16 11:56:56 -03:00
parent 774da00d16
commit 83c9e644b1
3 changed files with 20 additions and 10 deletions

View File

@ -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}`);
Meteor.setInterval(() => {
serverHealth();
}, 30000);
const LOG_CONFIG = Meteor.settings.private.serverLog;
const { healthChecker } = LOG_CONFIG;
const { enable: enableHealthCheck, intervalMs: healthCheckInterval } = healthChecker;
if (enableHealthCheck) {
Meteor.setInterval(() => {
serverHealth();
}, healthCheckInterval);
}
const { customHeartbeat } = APP_CONFIG;

View File

@ -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
});

View File

@ -798,6 +798,10 @@ private:
serverLog:
level: info
streamerLog: false
includeServerInfo: true
healthChecker:
enable: true
intervalMs: 30000
minBrowserVersions:
- browser: chrome
version: 72