make logging level configurable via env vars
This commit is contained in:
parent
4f613ab4d0
commit
0ff490dbf3
@ -88,7 +88,8 @@ INSIGHT_NETWORK [= 'livenet' | 'testnet']
|
|||||||
INSIGHT_DB # Path where to store insight's internal DB. (defaults to $HOME/.insight)
|
INSIGHT_DB # Path where to store insight's internal DB. (defaults to $HOME/.insight)
|
||||||
INSIGHT_SAFE_CONFIRMATIONS=6 # Nr. of confirmation needed to start caching transaction information
|
INSIGHT_SAFE_CONFIRMATIONS=6 # Nr. of confirmation needed to start caching transaction information
|
||||||
INSIGHT_IGNORE_CACHE # True to ignore cache of spents in transaction, with more than INSIGHT_SAFE_CONFIRMATIONS confirmations. This is useful for tracking double spents for old transactions.
|
INSIGHT_IGNORE_CACHE # True to ignore cache of spents in transaction, with more than INSIGHT_SAFE_CONFIRMATIONS confirmations. This is useful for tracking double spents for old transactions.
|
||||||
ENABLE_MAILBOX # if "true" will enable message broker module
|
ENABLE_MAILBOX # if "true" will enable mailbox plugin
|
||||||
|
LOGGER_LEVEL # defaults to 'info', can be 'debug','verbose','error', etc.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -77,6 +77,7 @@ var bitcoindConf = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var enableMailbox = process.env.ENABLE_MAILBOX === 'true';
|
var enableMailbox = process.env.ENABLE_MAILBOX === 'true';
|
||||||
|
var loggerLevel = process.env.LOGGER_LEVEL || 'info';
|
||||||
|
|
||||||
if (!fs.existsSync(db)) {
|
if (!fs.existsSync(db)) {
|
||||||
var err = fs.mkdirSync(db);
|
var err = fs.mkdirSync(db);
|
||||||
@ -90,6 +91,7 @@ if (!fs.existsSync(db)) {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
enableMailbox: enableMailbox,
|
enableMailbox: enableMailbox,
|
||||||
|
loggerLevel: loggerLevel,
|
||||||
version: version,
|
version: version,
|
||||||
root: rootPath,
|
root: rootPath,
|
||||||
publicPath: process.env.INSIGHT_PUBLIC_PATH || false,
|
publicPath: process.env.INSIGHT_PUBLIC_PATH || false,
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var config = require('../config/config');
|
||||||
|
|
||||||
var logger = new winston.Logger({
|
var logger = new winston.Logger({
|
||||||
transports: [
|
transports: [
|
||||||
@ -7,7 +8,7 @@ var logger = new winston.Logger({
|
|||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
logger.transports.console.level = 'debug';
|
logger.transports.console.level = config.loggerLevel;
|
||||||
logger.info('starting...');
|
logger.info('starting...');
|
||||||
|
|
||||||
module.exports.logger = logger;
|
module.exports.logger = logger;
|
||||||
|
|||||||
@ -8,7 +8,6 @@ module.exports.init = function(ext_io, config) {
|
|||||||
preconditions.checkArgument(ext_io);
|
preconditions.checkArgument(ext_io);
|
||||||
io = ext_io;
|
io = ext_io;
|
||||||
io.sockets.on('connection', function(socket) {
|
io.sockets.on('connection', function(socket) {
|
||||||
// when it requests sync, send him all pending messages
|
|
||||||
// when it requests sync, send him all pending messages
|
// when it requests sync, send him all pending messages
|
||||||
socket.on('sync', function(ts) {
|
socket.on('sync', function(ts) {
|
||||||
logger.debug('Sync requested by ' + socket.id);
|
logger.debug('Sync requested by ' + socket.id);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user