fix(log): putar log otomatis (10MB x 5) agar tak menumpuk

This commit is contained in:
oxpoe committed 2026-10-12 22:37:46 +07:00
1 parent dc5c1299d3
commit a1e1570221
1 file changed
+4 -4
+4 -4
View File
@@ -27,11 +27,11 @@ const logger = winston.createLogger({
transports: [ transports: [
// Log ke file // Log ke file
new winston.transports.File({ new winston.transports.File({
filename: path.join(logsDir, 'error.log'), filename: path.join(logsDir, 'error.log'), maxsize: 10485760, maxFiles: 5,
level: 'error' level: 'error'
}), }),
new winston.transports.File({ new winston.transports.File({
filename: path.join(logsDir, 'combined.log') filename: path.join(logsDir, 'combined.log'), maxsize: 10485760, maxFiles: 5
}), }),
// Log ke console // Log ke console
new winston.transports.Console({ new winston.transports.Console({
@@ -46,7 +46,7 @@ const logger = winston.createLogger({
], ],
exceptionHandlers: [ exceptionHandlers: [
new winston.transports.File({ new winston.transports.File({
filename: path.join(logsDir, 'exceptions.log') filename: path.join(logsDir, 'exceptions.log'), maxsize: 10485760, maxFiles: 5
}), }),
new winston.transports.Console({ new winston.transports.Console({
format: winston.format.combine( format: winston.format.combine(
@@ -60,7 +60,7 @@ const logger = winston.createLogger({
], ],
rejectionHandlers: [ rejectionHandlers: [
new winston.transports.File({ new winston.transports.File({
filename: path.join(logsDir, 'rejections.log') filename: path.join(logsDir, 'rejections.log'), maxsize: 10485760, maxFiles: 5
}) })
] ]
}); });