mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
🪚 refactor: Optimize CONSOLE_JSON Debug Logs with Truncation (#4709)
This commit is contained in:
parent
95201908e9
commit
493e64e6db
2 changed files with 24 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
const path = require('path');
|
||||
const winston = require('winston');
|
||||
require('winston-daily-rotate-file');
|
||||
const { redactFormat, redactMessage, debugTraverse } = require('./parsers');
|
||||
const { redactFormat, redactMessage, debugTraverse, jsonTruncateFormat } = require('./parsers');
|
||||
|
||||
const logDir = path.join(__dirname, '..', 'logs');
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ if (useDebugConsole) {
|
|||
new winston.transports.Console({
|
||||
level: 'debug',
|
||||
format: useConsoleJson
|
||||
? winston.format.combine(fileFormat, debugTraverse, winston.format.json())
|
||||
? winston.format.combine(fileFormat, jsonTruncateFormat(), winston.format.json())
|
||||
: winston.format.combine(fileFormat, debugTraverse),
|
||||
}),
|
||||
);
|
||||
|
|
@ -120,7 +120,7 @@ if (useDebugConsole) {
|
|||
transports.push(
|
||||
new winston.transports.Console({
|
||||
level: 'info',
|
||||
format: winston.format.combine(fileFormat, winston.format.json()),
|
||||
format: winston.format.combine(fileFormat, jsonTruncateFormat(), winston.format.json()),
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue