fixed cut overlays and solved the docker duplication thing

This commit is contained in:
2025-08-06 16:04:41 -06:00
parent f4327c3c40
commit 0d3a273e22
9 changed files with 248 additions and 3274 deletions

View File

@@ -1,20 +1,10 @@
const winston = require('winston');
const config = require('../config');
// Debug: Check if logger is being created multiple times
const instanceId = Math.random().toString(36).substr(2, 9);
console.log(`[DEBUG] Creating logger instance ${instanceId} at ${new Date().toISOString()}`);
// Ensure we only create one logger instance
if (global.appLogger) {
console.log(`[DEBUG] Reusing existing logger instance`);
module.exports = global.appLogger;
return;
}
// Create the logger only once
const logger = winston.createLogger({
level: config.isProduction ? 'info' : 'debug',
defaultMeta: { service: 'bnkops-map', instanceId },
defaultMeta: { service: 'bnkops-map' },
transports: [
new winston.transports.Console({
format: winston.format.combine(
@@ -50,7 +40,4 @@ if (config.isProduction) {
}));
}
// Store logger globally to prevent multiple instances
global.appLogger = logger;
module.exports = logger;