Browse Source

Add `info` error logging level

dev
webworker01 5 years ago
parent
commit
906392608e
  1. 30
      init.js
  2. 41
      libs/logUtil.js
  3. 6
      libs/networkStats.js
  4. 16
      libs/paymentProcessor.js
  5. 26
      libs/poolWorker.js
  6. 43
      libs/profitSwitch.js
  7. 4
      libs/shareProcessor.js
  8. 10
      libs/website.js

30
init.js

@ -37,7 +37,7 @@ var logger = new PoolLogger({
try {
require('newrelic');
if (cluster.isMaster)
logger.debug('NewRelic', 'Monitor', 'New Relic initiated');
logger.info('NewRelic', 'Monitor', 'New Relic initiated');
} catch(e) {}
@ -57,13 +57,13 @@ try{
// Set our server's uid to that user
if (uid) {
process.setuid(uid);
logger.debug('POSIX', 'Connection Limit', 'Raised to 100K concurrent connections, now running as non-root user: ' + process.getuid());
logger.info('POSIX', 'Connection Limit', 'Raised to 100K concurrent connections, now running as non-root user: ' + process.getuid());
}
}
}
catch(e){
if (cluster.isMaster)
logger.debug('POSIX', 'Connection Limit', '(Safe to ignore) POSIX module not installed and resource (connection) limit was not raised');
logger.info('POSIX', 'Connection Limit', '(Safe to ignore) POSIX module not installed and resource (connection) limit was not raised');
}
if (cluster.isWorker){
@ -87,7 +87,7 @@ if (cluster.isWorker){
}
return;
}
}
//Read all pool configs from pool_configs and join them with their coin profile
@ -194,7 +194,7 @@ var spawnPoolWorkers = function(){
var redisConfig;
var connection;
Object.keys(poolConfigs).forEach(function(coin){
var pcfg = poolConfigs[coin];
if (!Array.isArray(pcfg.daemons) || pcfg.daemons.length < 1){
@ -204,7 +204,7 @@ var spawnPoolWorkers = function(){
redisConfig = pcfg.redis;
connection = redis.createClient(redisConfig.port, redisConfig.host);
connection.on('ready', function(){
logger.debug('PPLNT', coin, 'TimeShare processing setup with redis (' + redisConfig.host +
logger.info('PPLNT', coin, 'TimeShare processing setup with redis (' + redisConfig.host +
':' + redisConfig.port + ')');
});
}
@ -260,7 +260,7 @@ var spawnPoolWorkers = function(){
var lastShareTime = now;
var lastStartTime = now;
var workerAddress = msg.data.worker.split('.')[0];
// if needed, initialize PPLNT objects for coin
if (!_lastShareTimes[msg.coin]) {
_lastShareTimes[msg.coin] = {};
@ -268,7 +268,7 @@ var spawnPoolWorkers = function(){
if (!_lastStartTimes[msg.coin]) {
_lastStartTimes[msg.coin] = {};
}
// did they just join in this round?
if (!_lastShareTimes[msg.coin][workerAddress] || !_lastStartTimes[msg.coin][workerAddress]) {
_lastShareTimes[msg.coin][workerAddress] = now;
@ -280,16 +280,16 @@ var spawnPoolWorkers = function(){
lastShareTime = _lastShareTimes[msg.coin][workerAddress];
lastStartTime = _lastStartTimes[msg.coin][workerAddress];
}
var redisCommands = [];
// if its been less than 15 minutes since last share was submitted
var timeChangeSec = roundTo(Math.max(now - lastShareTime, 0) / 1000, 4);
//var timeChangeTotal = roundTo(Math.max(now - lastStartTime, 0) / 1000, 4);
if (timeChangeSec < 900 && msg.trackShares) {
// loyal miner keeps mining :)
redisCommands.push(['hincrbyfloat', msg.coin + ':shares:timesCurrent', workerAddress + "." + poolConfigs[msg.coin].poolId, timeChangeSec]);
//logger.debug('PPLNT', msg.coin, 'Thread '+msg.thread, workerAddress+':{totalTimeSec:'+timeChangeTotal+', timeChangeSec:'+timeChangeSec+'}');
redisCommands.push(['hincrbyfloat', msg.coin + ':shares:timesCurrent', workerAddress + "." + poolConfigs[msg.coin].poolId, timeChangeSec]);
//logger.info('PPLNT', msg.coin, 'Thread '+msg.thread, workerAddress+':{totalTimeSec:'+timeChangeTotal+', timeChangeSec:'+timeChangeSec+'}');
connection.multi(redisCommands).exec(function(err, replies){
if (err)
logger.error('PPLNT', msg.coin, 'Thread '+msg.thread, 'Error with time share processor call to redis ' + JSON.stringify(err));
@ -299,7 +299,7 @@ var spawnPoolWorkers = function(){
_lastStartTimes[workerAddress] = now;
logger.debug('PPLNT', msg.coin, 'Thread '+msg.thread, workerAddress+' re-joined.');
}
// track last time share
_lastShareTimes[msg.coin][workerAddress] = now;
}
@ -319,7 +319,7 @@ var spawnPoolWorkers = function(){
i++;
if (i === numForks){
clearInterval(spawnInterval);
logger.debug('Master', 'PoolSpawner', 'Spawned ' + Object.keys(poolConfigs).length + ' pool(s) on ' + numForks + ' thread(s)');
logger.info('Master', 'PoolSpawner', 'Spawned ' + Object.keys(poolConfigs).length + ' pool(s) on ' + numForks + ' thread(s)');
}
}, 250);
@ -331,7 +331,7 @@ var startCliListener = function(){
var listener = new CliListener(cliPort);
listener.on('log', function(text){
logger.debug('Master', 'CLI', text);
logger.info('Master', 'CLI', text);
}).on('command', function(command, params, options, reply){
switch(command){

41
libs/logUtil.js

@ -8,6 +8,8 @@ var severityToColor = function(severity, text) {
return text.cyan.underline;
case 'debug':
return text.green;
case 'info':
return text.green;
case 'warning':
return text.yellow;
case 'error':
@ -20,25 +22,24 @@ var severityToColor = function(severity, text) {
var severityValues = {
'debug': 1,
'warning': 2,
'error': 3,
'special': 4
'info' : 2,
'warning': 3,
'error': 4,
'special': 5
};
var PoolLogger = function (configuration) {
var PoolLogger = function(configuration) {
var logLevelInt = severityValues[configuration.logLevel];
var logColors = configuration.logColors;
var log = function(severity, system, component, text, subcat) {
if (severityValues[severity] < logLevelInt) return;
if (severityValues[severity] < logLevelInt) {
return;
}
if (subcat){
if (subcat) {
var realText = subcat;
var realSubCat = text;
text = realText;
@ -49,19 +50,14 @@ var PoolLogger = function (configuration) {
if (logColors) {
entryDesc = severityToColor(severity, entryDesc);
var logString =
entryDesc +
('[' + component + '] ').italic;
var logString = entryDesc + ('[' + component + '] ').italic;
if (subcat)
logString += ('(' + subcat + ') ').bold.grey;
logString += text.grey;
}
else {
var logString =
entryDesc +
'[' + component + '] ';
} else {
var logString = entryDesc + '[' + component + '] ';
if (subcat)
logString += '(' + subcat + ') ';
@ -70,15 +66,12 @@ var PoolLogger = function (configuration) {
}
console.log(logString);
};
// public
var _this = this;
Object.keys(severityValues).forEach(function(logType){
_this[logType] = function(){
Object.keys(severityValues).forEach(function(logType) {
_this[logType] = function() {
var args = Array.prototype.slice.call(arguments, 0);
args.unshift(logType);
log.apply(this, args);
@ -86,4 +79,4 @@ var PoolLogger = function (configuration) {
});
};
module.exports = PoolLogger;
module.exports = PoolLogger;

6
libs/networkStats.js

@ -29,9 +29,9 @@ module.exports = function(logger){
var logSystem = 'Payments';
var logComponent = coin;
logger.debug(logSystem, logComponent, 'Network stats setup with daemon ('
logger.info(logSystem, logComponent, 'Network stats setup with daemon ('
+ daemonConfig.user + '@' + daemonConfig.host + ':' + daemonConfig.port
+ ') and redis (' + poolOptions.redis.host + ':' + poolOptions.redis.port + ')');
+ ') and redis (' + poolOptions.redis.host + ':' + poolOptions.redis.port + ')');
});
});
};
@ -118,7 +118,7 @@ function SetupForStats(logger, poolOptions, setupFinished) {
var coin = logComponent.replace('_testnet', '').toLowerCase();
if (coin == 'zen')
coin = 'zencash';
request('https://api.coinmarketcap.com/v1/ticker/'+coin+'/', function (error, response, body) {
if (error) {
logger.error(logSystem, logComponent, 'Error with http request to https://api.coinmarketcap.com/ ' + JSON.stringify(error));

16
libs/paymentProcessor.js

@ -32,7 +32,7 @@ module.exports = function(logger) {
var logSystem = 'Payments';
var logComponent = coin;
logger.debug(logSystem, logComponent, 'Payment processing setup with daemon ('
logger.info(logSystem, logComponent, 'Payment processing setup with daemon ('
+ processingConfig.daemon.user + '@' + processingConfig.daemon.host + ':' + processingConfig.daemon.port
+ ') and redis (' + poolOptions.redis.host + ':' + poolOptions.redis.port + ')');
});
@ -86,11 +86,11 @@ function SetupForPool(logger, poolOptions, setupFinished) {
var fee = parseFloat(poolOptions.coin.txfee) || parseFloat(0.0004);
logger.debug(logSystem, logComponent, logComponent + ' requireShielding: ' + requireShielding);
logger.debug(logSystem, logComponent, logComponent + ' minConf: ' + minConfShield);
logger.debug(logSystem, logComponent, logComponent + ' payments txfee reserve: ' + fee);
logger.debug(logSystem, logComponent, logComponent + ' maxBlocksPerPayment: ' + maxBlocksPerPayment);
logger.debug(logSystem, logComponent, logComponent + ' PPLNT: ' + pplntEnabled + ', time period: '+pplntTimeQualify);
logger.info(logSystem, logComponent, logComponent + ' requireShielding: ' + requireShielding);
logger.info(logSystem, logComponent, logComponent + ' minConf: ' + minConfShield);
logger.info(logSystem, logComponent, logComponent + ' payments txfee reserve: ' + fee);
logger.info(logSystem, logComponent, logComponent + ' maxBlocksPerPayment: ' + maxBlocksPerPayment);
logger.info(logSystem, logComponent, logComponent + ' PPLNT: ' + pplntEnabled + ', time period: '+pplntTimeQualify);
var daemon = new Stratum.daemon.interface([processingConfig.daemon], function(severity, message){
logger[severity](logSystem, logComponent, message);
@ -726,7 +726,7 @@ function SetupForPool(logger, poolOptions, setupFinished) {
} else {
// keep unique valid block
validBlocks[dups[i].blockHash] = dups[i].serialized;
logger.debug(logSystem, logComponent, 'Keep valid duplicate block ' + block.result.height + ' > ' + block.result.hash);
logger.info(logSystem, logComponent, 'Keep valid duplicate block ' + block.result.height + ' > ' + block.result.hash);
}
}
}
@ -1581,7 +1581,7 @@ function SetupForPool(logger, poolOptions, setupFinished) {
], function(){
//On complete
var paymentProcessTime = Date.now() - startPaymentProcess;
logger.debug(logSystem, logComponent, 'Finished interval - time spent: '
logger.info(logSystem, logComponent, 'Finished interval - time spent: '
+ paymentProcessTime + 'ms total, ' + timeSpentRedis + 'ms redis, '
+ timeSpentRPC + 'ms daemon RPC');
});

26
libs/poolWorker.js

@ -64,11 +64,11 @@ module.exports = function(logger){
var proxyPorts = Object.keys(proxySwitch[switchName].ports);
if (newCoin == oldCoin) {
logger.debug(logSystem, logComponent, logSubCat, 'Switch message would have no effect - ignoring ' + newCoin);
logger.info(logSystem, logComponent, logSubCat, 'Switch message would have no effect - ignoring ' + newCoin);
break;
}
logger.debug(logSystem, logComponent, logSubCat, 'Proxy message for ' + algo + ' from ' + oldCoin + ' to ' + newCoin);
logger.info(logSystem, logComponent, logSubCat, 'Proxy message for ' + algo + ' from ' + oldCoin + ' to ' + newCoin);
if (newPool) {
oldPool.relinquishMiners(
@ -87,7 +87,7 @@ module.exports = function(logger){
logger.error(logSystem, logComponent, logSubCat, 'Redis error writing proxy config: ' + JSON.stringify(err))
}
else {
logger.debug(logSystem, logComponent, logSubCat, 'Last proxy state saved to redis for ' + algo);
logger.info(logSystem, logComponent, logSubCat, 'Last proxy state saved to redis for ' + algo);
}
});
@ -159,7 +159,7 @@ module.exports = function(logger){
var authString = authorized ? 'Authorized' : 'Unauthorized ';
logger.debug(logSystem, logComponent, logSubCat, authString + ' ' + workerName + ':' + password + ' [' + ip + ']');
logger.info(logSystem, logComponent, logSubCat, authString + ' ' + workerName + ':' + password + ' [' + ip + ']');
callback({
error: null,
authorized: authorized,
@ -175,10 +175,10 @@ module.exports = function(logger){
var shareData = JSON.stringify(data);
if (data.blockHash && !isValidBlock)
logger.debug(logSystem, logComponent, logSubCat, 'We thought a block was found but it was rejected by the daemon, share data: ' + shareData);
logger.info(logSystem, logComponent, logSubCat, 'We thought a block was found but it was rejected by the daemon, share data: ' + shareData);
else if (isValidBlock)
logger.debug(logSystem, logComponent, logSubCat, 'Block found: ' + data.blockHash + ' by ' + data.worker);
logger.info(logSystem, logComponent, logSubCat, 'Block found: ' + data.blockHash + ' by ' + data.worker);
if (isValidShare) {
if(data.shareDiff > 1000000000) {
@ -188,7 +188,7 @@ module.exports = function(logger){
}
//logger.debug(logSystem, logComponent, logSubCat, 'Share accepted at diff ' + data.difficulty + '/' + data.shareDiff + ' by ' + data.worker + ' [' + data.ip + ']' );
} else if (!isValidShare) {
logger.debug(logSystem, logComponent, logSubCat, 'Share rejected: ' + shareData);
logger.info(logSystem, logComponent, logSubCat, 'Share rejected: ' + shareData);
}
// handle the share
@ -225,9 +225,7 @@ module.exports = function(logger){
// Load proxy state for each algorithm from redis which allows NOMP to resume operation
// on the last pool it was using when reloaded or restarted
//
logger.debug(logSystem, logComponent, logSubCat, 'Loading last proxy state from redis');
logger.info(logSystem, logComponent, logSubCat, 'Loading last proxy state from redis');
/*redisClient.on('error', function(err){
logger.debug(logSystem, logComponent, logSubCat, 'Pool configuration failed: ' + err);
@ -236,7 +234,7 @@ module.exports = function(logger){
redisClient.hgetall("proxyState", function(error, obj) {
if (!error && obj) {
proxyState = obj;
logger.debug(logSystem, logComponent, logSubCat, 'Last proxy state loaded from redis');
logger.info(logSystem, logComponent, logSubCat, 'Last proxy state loaded from redis');
}
//
@ -265,7 +263,7 @@ module.exports = function(logger){
var f = net.createServer(function(socket) {
var currentPool = proxySwitch[switchName].currentPool;
logger.debug(logSystem, 'Connect', logSubCat, 'Connection to '
logger.info(logSystem, 'Connect', logSubCat, 'Connection to '
+ switchName + ' from '
+ socket.remoteAddress + ' on '
+ port + ' routing to ' + currentPool);
@ -276,7 +274,7 @@ module.exports = function(logger){
pools[initalPool].getStratumServer().handleNewClient(socket);
}).listen(parseInt(port), function() {
logger.debug(logSystem, logComponent, logSubCat, 'Switching "' + switchName
logger.info(logSystem, logComponent, logSubCat, 'Switching "' + switchName
+ '" listening for ' + algorithm
+ ' on port ' + port
+ ' into ' + proxySwitch[switchName].currentPool);
@ -305,7 +303,7 @@ module.exports = function(logger){
//
this.setDifficultyForProxyPort = function(pool, coin, algo) {
logger.debug(logSystem, logComponent, algo, 'Setting proxy difficulties after pool start');
logger.info(logSystem, logComponent, algo, 'Setting proxy difficulties after pool start');
Object.keys(portalConfig.switching).forEach(function(switchName) {
if (!portalConfig.switching[switchName].enabled) return;

43
libs/profitSwitch.js

@ -19,7 +19,7 @@ module.exports = function(logger){
var logSystem = 'Profit';
//
//
// build status tracker for collecting coin market information
//
var profitStatus = {};
@ -44,7 +44,7 @@ module.exports = function(logger){
});
//
//
// ensure we have something to switch
//
Object.keys(profitStatus).forEach(function(algo){
@ -57,12 +57,12 @@ module.exports = function(logger){
}
});
if (Object.keys(profitStatus).length == 0){
logger.debug(logSystem, 'Config', 'No alternative coins to switch to in current config, switching disabled.');
logger.info(logSystem, 'Config', 'No alternative coins to switch to in current config, switching disabled.');
return;
}
//
//
// setup APIs
//
var poloApi = new Poloniex(
@ -83,7 +83,7 @@ module.exports = function(logger){
// 'API_SECRET'
);
//
//
// market data collection from Poloniex
//
this.getProfitDataPoloniex = function(callback){
@ -139,12 +139,12 @@ module.exports = function(logger){
var marketData = profitStatus[symbolToAlgorithmMap[symbol]][symbol].exchangeInfo['Poloniex'];
if (marketData.hasOwnProperty('BTC') && marketData['BTC'].bid > 0){
depthTasks.push(function(callback){
_this.getMarketDepthFromPoloniex('BTC', symbol, marketData['BTC'].bid, callback)
_this.getMarketDepthFromPoloniex('BTC', symbol, marketData['BTC'].bid, callback)
});
}
if (marketData.hasOwnProperty('LTC') && marketData['LTC'].bid > 0){
depthTasks.push(function(callback){
_this.getMarketDepthFromPoloniex('LTC', symbol, marketData['LTC'].bid, callback)
_this.getMarketDepthFromPoloniex('LTC', symbol, marketData['LTC'].bid, callback)
});
}
});
@ -168,7 +168,7 @@ module.exports = function(logger){
}
callback(null);
});
};
this.getMarketDepthFromPoloniex = function(symbolA, symbolB, coinPrice, callback){
poloApi.getOrderBook(symbolA, symbolB, function(err, data){
@ -199,7 +199,7 @@ module.exports = function(logger){
});
};
this.getProfitDataCryptsy = function(callback){
async.series([
function(taskCallback){
@ -285,7 +285,7 @@ module.exports = function(logger){
}
callback(null);
});
};
@ -339,12 +339,12 @@ module.exports = function(logger){
var marketData = profitStatus[symbolToAlgorithmMap[symbol]][symbol].exchangeInfo['Mintpal'];
if (marketData.hasOwnProperty('BTC') && marketData['BTC'].bid > 0){
depthTasks.push(function(callback){
_this.getMarketDepthFromMintpal('BTC', symbol, marketData['BTC'].bid, callback)
_this.getMarketDepthFromMintpal('BTC', symbol, marketData['BTC'].bid, callback)
});
}
if (marketData.hasOwnProperty('LTC') && marketData['LTC'].bid > 0){
depthTasks.push(function(callback){
_this.getMarketDepthFromMintpal('LTC', symbol, marketData['LTC'].bid, callback)
_this.getMarketDepthFromMintpal('LTC', symbol, marketData['LTC'].bid, callback)
});
}
});
@ -451,12 +451,12 @@ module.exports = function(logger){
var marketData = profitStatus[symbolToAlgorithmMap[symbol]][symbol].exchangeInfo['Bittrex'];
if (marketData.hasOwnProperty('BTC') && marketData['BTC'].bid > 0){
depthTasks.push(function(callback){
_this.getMarketDepthFromBittrex('BTC', symbol, marketData['BTC'].bid, callback)
_this.getMarketDepthFromBittrex('BTC', symbol, marketData['BTC'].bid, callback)
});
}
if (marketData.hasOwnProperty('LTC') && marketData['LTC'].bid > 0){
depthTasks.push(function(callback){
_this.getMarketDepthFromBittrex('LTC', symbol, marketData['LTC'].bid, callback)
_this.getMarketDepthFromBittrex('LTC', symbol, marketData['LTC'].bid, callback)
});
}
});
@ -554,7 +554,7 @@ module.exports = function(logger){
// some shitcoins dont provide target, only bits, so we need to deal with both
var target = response.target ? bignum(response.target, 16) : util.bignumFromBitsHex(response.bits);
coinStatus.difficulty = parseFloat((diff1 / target.toNumber()).toFixed(9));
logger.debug(logSystem, symbol, 'difficulty is ' + coinStatus.difficulty);
logger.info(logSystem, symbol, 'difficulty is ' + coinStatus.difficulty);
coinStatus.reward = response.coinbasevalue / 100000000;
callback(null);
@ -596,7 +596,7 @@ module.exports = function(logger){
bestCoin = profitStatus[algo][symbol].name;
}
coinStatus.btcPerMhPerHour = btcPerMhPerHour;
logger.debug(logSystem, 'CALC', 'BTC/' + symbol + ' on ' + exchange + ' with ' + coinStatus.btcPerMhPerHour.toFixed(8) + ' BTC/day per Mh/s');
logger.info(logSystem, 'CALC', 'BTC/' + symbol + ' on ' + exchange + ' with ' + coinStatus.btcPerMhPerHour.toFixed(8) + ' BTC/day per Mh/s');
}
if (exchangeData.hasOwnProperty('LTC') && exchangeData['LTC'].hasOwnProperty('weightedBid')){
var btcPerMhPerHour = (exchangeData['LTC'].weightedBid * coinStatus.coinsPerMhPerHour) * exchangeData['LTC'].ltcToBtc;
@ -606,12 +606,11 @@ module.exports = function(logger){
bestCoin = profitStatus[algo][symbol].name;
}
coinStatus.btcPerMhPerHour = btcPerMhPerHour;
logger.debug(logSystem, 'CALC', 'LTC/' + symbol + ' on ' + exchange + ' with ' + coinStatus.btcPerMhPerHour.toFixed(8) + ' BTC/day per Mh/s');
logger.info(logSystem, 'CALC', 'LTC/' + symbol + ' on ' + exchange + ' with ' + coinStatus.btcPerMhPerHour.toFixed(8) + ' BTC/day per Mh/s');
}
});
});
logger.debug(logSystem, 'RESULT', 'Best coin for ' + algo + ' is ' + bestCoin + ' on ' + bestExchange + ' with ' + bestBtcPerMhPerHour.toFixed(8) + ' BTC/day per Mh/s');
logger.info(logSystem, 'RESULT', 'Best coin for ' + algo + ' is ' + bestCoin + ' on ' + bestExchange + ' with ' + bestBtcPerMhPerHour.toFixed(8) + ' BTC/day per Mh/s');
var client = net.connect(portalConfig.cliPort, function () {
client.write(JSON.stringify({
@ -631,7 +630,7 @@ module.exports = function(logger){
var checkProfitability = function(){
logger.debug(logSystem, 'Check', 'Collecting profitability data.');
logger.info(logSystem, 'Check', 'Collecting profitability data.');
profitabilityTasks = [];
if (portalConfig.profitSwitch.usePoloniex)
@ -649,7 +648,7 @@ module.exports = function(logger){
profitabilityTasks.push(_this.getCoindDaemonInfo);
profitabilityTasks.push(_this.getMiningRate);
// has to be series
// has to be series
async.series(profitabilityTasks, function(err){
if (err){
logger.error(logSystem, 'Check', 'Error while checking profitability: ' + err);
@ -657,7 +656,7 @@ module.exports = function(logger){
}
//
// TODO offer support for a userConfigurable function for deciding on coin to override the default
//
//
_this.switchToMostProfitableCoins();
});
};

4
libs/shareProcessor.js

@ -21,13 +21,13 @@ module.exports = function(logger, poolConfig){
var logSystem = 'Pool';
var logComponent = coin;
var logSubCat = 'Thread ' + (parseInt(forkId) + 1);
var connection = redis.createClient(redisConfig.port, redisConfig.host);
if (redisConfig.password) {
connection.auth(redisConfig.password);
}
connection.on('ready', function(){
logger.debug(logSystem, logComponent, logSubCat, 'Share processing setup with redis (' + redisConfig.host +
logger.info(logSystem, logComponent, logSubCat, 'Share processing setup with redis (' + redisConfig.host +
':' + redisConfig.port + ')');
});
connection.on('error', function(err){

10
libs/website.js

@ -100,7 +100,7 @@ module.exports = function(logger){
basename = path.basename(evt);
else
basename = path.basename(filename);
if (basename in pageFiles){
readPageFiles([basename]);
logger.special(logSystem, 'Server', 'Reloaded file ' + basename);
@ -243,7 +243,7 @@ module.exports = function(logger){
res.send(500, 'Something broke!');
});
try {
try {
if (portalConfig.website.tlsOptions && portalConfig.website.tlsOptions.enabled === true) {
var TLSoptions = {
key: fs.readFileSync(portalConfig.website.tlsOptions.key),
@ -251,11 +251,11 @@ module.exports = function(logger){
};
https.createServer(TLSoptions, app).listen(portalConfig.website.port, portalConfig.website.host, function() {
logger.debug(logSystem, 'Server', 'TLS Website started on ' + portalConfig.website.host + ':' + portalConfig.website.port);
});
logger.info(logSystem, 'Server', 'TLS Website started on ' + portalConfig.website.host + ':' + portalConfig.website.port);
});
} else {
app.listen(portalConfig.website.port, portalConfig.website.host, function () {
logger.debug(logSystem, 'Server', 'Website started on ' + portalConfig.website.host + ':' + portalConfig.website.port);
logger.info(logSystem, 'Server', 'Website started on ' + portalConfig.website.host + ':' + portalConfig.website.port);
});
}
}

Loading…
Cancel
Save