ultra-dex 3.4.1 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils/monitoring.js +22 -13
- package/package.json +1 -1
package/lib/utils/monitoring.js
CHANGED
|
@@ -205,6 +205,27 @@ async function createLoggerInstance() {
|
|
|
205
205
|
|
|
206
206
|
await ensureLogDirectory();
|
|
207
207
|
|
|
208
|
+
// Only add console transport in debug mode or when explicitly requested
|
|
209
|
+
const logTransports = [
|
|
210
|
+
new transports.File({
|
|
211
|
+
filename: MONITORING_CONFIG.logFile,
|
|
212
|
+
maxSize: MONITORING_CONFIG.maxLogSize,
|
|
213
|
+
maxFiles: MONITORING_CONFIG.maxLogFiles
|
|
214
|
+
})
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
// Add console transport only for debug mode
|
|
218
|
+
if (MONITORING_CONFIG.logLevel === 'debug' || process.env.DEBUG) {
|
|
219
|
+
logTransports.push(
|
|
220
|
+
new transports.Console({
|
|
221
|
+
format: format.combine(
|
|
222
|
+
format.colorize(),
|
|
223
|
+
format.simple()
|
|
224
|
+
)
|
|
225
|
+
})
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
208
229
|
return createLogger({
|
|
209
230
|
level: MONITORING_CONFIG.logLevel,
|
|
210
231
|
format: format.combine(
|
|
@@ -214,19 +235,7 @@ async function createLoggerInstance() {
|
|
|
214
235
|
format.json()
|
|
215
236
|
),
|
|
216
237
|
defaultMeta: { service: 'ultra-dex' },
|
|
217
|
-
transports:
|
|
218
|
-
new transports.File({
|
|
219
|
-
filename: MONITORING_CONFIG.logFile,
|
|
220
|
-
maxSize: MONITORING_CONFIG.maxLogSize,
|
|
221
|
-
maxFiles: MONITORING_CONFIG.maxLogFiles
|
|
222
|
-
}),
|
|
223
|
-
new transports.Console({
|
|
224
|
-
format: format.combine(
|
|
225
|
-
format.colorize(),
|
|
226
|
-
format.simple()
|
|
227
|
-
)
|
|
228
|
-
})
|
|
229
|
-
]
|
|
238
|
+
transports: logTransports
|
|
230
239
|
});
|
|
231
240
|
}
|
|
232
241
|
|