diff --git a/backend/src/api/bisq/bisq.ts b/backend/src/api/bisq/bisq.ts index 8167318e9..3bdbf7d75 100644 --- a/backend/src/api/bisq/bisq.ts +++ b/backend/src/api/bisq/bisq.ts @@ -82,7 +82,7 @@ class Bisq { private checkForBisqDataFolder() { if (!fs.existsSync(config.BISQ_BLOCKS_DATA_PATH + Bisq.BLOCKS_JSON_FILE_PATH)) { - logger.info(config.BISQ_BLOCKS_DATA_PATH + Bisq.BLOCKS_JSON_FILE_PATH + ` doesn't exist. Make sure Bisq is running and the config is correct before starting the server.`); + logger.warn(config.BISQ_BLOCKS_DATA_PATH + Bisq.BLOCKS_JSON_FILE_PATH + ` doesn't exist. Make sure Bisq is running and the config is correct before starting the server.`); return process.exit(1); } } @@ -100,7 +100,7 @@ class Bisq { this.subdirectoryWatcher.close(); } fsWait = setTimeout(() => { - logger.info(`Bisq restart detected. Resetting both watchers in 3 minutes.`); + logger.debug(`Bisq restart detected. Resetting both watchers in 3 minutes.`); setTimeout(() => { this.startTopDirectoryWatcher(); this.startSubDirectoryWatcher(); @@ -125,7 +125,7 @@ class Bisq { clearTimeout(fsWait); } fsWait = setTimeout(() => { - logger.info(`Change detected in the Bisq data folder.`); + logger.debug(`Change detected in the Bisq data folder.`); this.loadBisqDumpFile(); }, 2000); }); @@ -198,7 +198,7 @@ class Bisq { }); const time = new Date().getTime() - start; - logger.info('Bisq data index rebuilt in ' + time + ' ms'); + logger.debug('Bisq data index rebuilt in ' + time + ' ms'); } private calculateStats() { @@ -236,14 +236,14 @@ class Bisq { private async loadBisqBlocksDump(cacheData: string): Promise { const start = new Date().getTime(); if (cacheData && cacheData.length !== 0) { - logger.info('Processing Bisq data dump...'); + logger.debug('Processing Bisq data dump...'); const data: BisqBlocks = JSON.parse(cacheData); if (data.blocks && data.blocks.length !== this.blocks.length) { this.blocks = data.blocks.filter((block) => block.txs.length > 0); this.blocks.reverse(); this.latestBlockHeight = data.chainHeight; const time = new Date().getTime() - start; - logger.info('Bisq dump processed in ' + time + ' ms'); + logger.debug('Bisq dump processed in ' + time + ' ms'); } else { throw new Error(`Bisq dump didn't contain any blocks`); } diff --git a/backend/src/api/bisq/markets.ts b/backend/src/api/bisq/markets.ts index 96b70dbcc..df1921a10 100644 --- a/backend/src/api/bisq/markets.ts +++ b/backend/src/api/bisq/markets.ts @@ -51,7 +51,7 @@ class Bisq { clearTimeout(fsWait); } fsWait = setTimeout(() => { - logger.info(`Change detected in the Bisq market data folder.`); + logger.debug(`Change detected in the Bisq market data folder.`); this.loadBisqDumpFile(); }, Bisq.FOLDER_WATCH_CHANGE_DETECTION_DEBOUNCE); }); @@ -66,7 +66,7 @@ class Bisq { if (cryptoMtime > this.cryptoCurrencyLastMtime || fiatMtime > this.fiatCurrencyLastMtime) { const cryptoCurrencyData = await this.loadData(Bisq.MARKET_JSON_FILE_PATHS.cryptoCurrency); const fiatCurrencyData = await this.loadData(Bisq.MARKET_JSON_FILE_PATHS.fiatCurrency); - logger.info('Updating Bisq Market Currency Data'); + logger.debug('Updating Bisq Market Currency Data'); bisqMarket.setCurrencyData(cryptoCurrencyData, fiatCurrencyData); if (cryptoMtime > this.cryptoCurrencyLastMtime) { this.cryptoCurrencyLastMtime = cryptoMtime; @@ -79,7 +79,7 @@ class Bisq { const offersMtime = this.getFileMtime(Bisq.MARKET_JSON_FILE_PATHS.offers); if (offersMtime > this.offersLastMtime) { const offersData = await this.loadData(Bisq.MARKET_JSON_FILE_PATHS.offers); - logger.info('Updating Bisq Market Offers Data'); + logger.debug('Updating Bisq Market Offers Data'); bisqMarket.setOffersData(offersData); this.offersLastMtime = offersMtime; marketsDataUpdated = true; @@ -87,7 +87,7 @@ class Bisq { const tradesMtime = this.getFileMtime(Bisq.MARKET_JSON_FILE_PATHS.trades); if (tradesMtime > this.tradesLastMtime) { const tradesData = await this.loadData(Bisq.MARKET_JSON_FILE_PATHS.trades); - logger.info('Updating Bisq Market Trades Data'); + logger.debug('Updating Bisq Market Trades Data'); bisqMarket.setTradesData(tradesData); this.tradesLastMtime = tradesMtime; marketsDataUpdated = true; @@ -95,7 +95,7 @@ class Bisq { if (marketsDataUpdated) { bisqMarket.updateCache(); const time = new Date().getTime() - start; - logger.info('Bisq market data updated in ' + time + ' ms'); + logger.debug('Bisq market data updated in ' + time + ' ms'); } } catch (e) { logger.err('loadBisqMarketDataDumpFile() error.' + e.message); diff --git a/backend/src/api/blocks.ts b/backend/src/api/blocks.ts index 3a63f75df..deb9d05b8 100644 --- a/backend/src/api/blocks.ts +++ b/backend/src/api/blocks.ts @@ -79,7 +79,7 @@ class Blocks { } } - logger.info(`${found} of ${txIds.length} found in mempool. ${notFound} not found.`); + logger.debug(`${found} of ${txIds.length} found in mempool. ${notFound} not found.`); block.reward = transactions[0].vout.reduce((acc, curr) => acc + curr.value, 0); block.coinbaseTx = this.stripCoinbaseTransaction(transactions[0]); diff --git a/backend/src/api/donations.ts b/backend/src/api/donations.ts index 3178094a4..20e669bbb 100644 --- a/backend/src/api/donations.ts +++ b/backend/src/api/donations.ts @@ -46,7 +46,7 @@ class Donations { } async $handleWebhookRequest(data: any) { - logger.debug('Received BTCPayServer webhook data: ' + JSON.stringify(data)); + logger.notice('Received BTCPayServer webhook data: ' + JSON.stringify(data)); if (!data || !data.id) { return; } diff --git a/backend/src/api/fiat-conversion.ts b/backend/src/api/fiat-conversion.ts index 1089bc805..3e635a9c7 100644 --- a/backend/src/api/fiat-conversion.ts +++ b/backend/src/api/fiat-conversion.ts @@ -22,7 +22,7 @@ class FiatConversion { private updateCurrency() { request('https://api.opennode.co/v1/rates', { json: true }, (err, res, body) => { - if (err) { return logger.info(err); } + if (err) { return logger.err(err); } if (body && body.data) { this.tickers = body.data; } diff --git a/backend/src/api/mempool.ts b/backend/src/api/mempool.ts index 4eedb89a7..cd069ee5d 100644 --- a/backend/src/api/mempool.ts +++ b/backend/src/api/mempool.ts @@ -138,10 +138,10 @@ class Mempool { if (this.mempoolProtection === 0 && transactions.length / currentMempoolSize <= 0.80) { this.mempoolProtection = 1; this.inSync = false; - logger.info('Mempool clear protection triggered.'); + logger.warn('Mempool clear protection triggered.'); setTimeout(() => { this.mempoolProtection = 2; - logger.info('Mempool clear protection resumed.'); + logger.warn('Mempool clear protection resumed.'); }, 1000 * 60 * 2); } diff --git a/backend/src/index.ts b/backend/src/index.ts index 4555ab068..5b606ead5 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -47,7 +47,7 @@ class Server { cluster.on('exit', (worker, code, signal) => { const workerId = worker.process['env'].workerId; - logger.info(`Mempool Worker PID #${worker.process.pid} workerId: ${workerId} died. Restarting in 10 seconds... ${signal || code}`); + logger.warn(`Mempool Worker PID #${worker.process.pid} workerId: ${workerId} died. Restarting in 10 seconds... ${signal || code}`); setTimeout(() => { const env = { workerId: workerId }; const newWorker = cluster.fork(env); diff --git a/backend/src/routes.ts b/backend/src/routes.ts index d492cdb14..fd89f3a55 100644 --- a/backend/src/routes.ts +++ b/backend/src/routes.ts @@ -29,7 +29,7 @@ class Routes { this.cache['3m'] = await statistics.$list3M(); this.cache['6m'] = await statistics.$list6M(); this.cache['1y'] = await statistics.$list1Y(); - logger.info('Statistics cache created'); + logger.debug('Statistics cache created'); } public async get2HStatistics(req: Request, res: Response) {