fix: pino worker error

This commit is contained in:
2025-05-23 22:23:31 +04:00
parent af10faf664
commit f0e3972013
2 changed files with 0 additions and 11 deletions

View File

@@ -1,13 +1,5 @@
import pino from 'pino'; import pino from 'pino';
import pretty from 'pino-pretty'; import pretty from 'pino-pretty';
import path from 'path';
const fileLogger = pino({
transport: {
target: 'pino/file',
options: { destination: path.join(process.cwd(), 'config', 'app.log') },
},
});
const consoleLogger = pino( const consoleLogger = pino(
pretty({ pretty({
@@ -18,15 +10,12 @@ const consoleLogger = pino(
const logger = { const logger = {
info: (msg: string, ...args: any[]) => { info: (msg: string, ...args: any[]) => {
fileLogger.info(msg, ...args);
consoleLogger.info(msg, ...args); consoleLogger.info(msg, ...args);
}, },
error: (msg: string, ...args: any[]) => { error: (msg: string, ...args: any[]) => {
fileLogger.error(msg, ...args);
consoleLogger.error(msg, ...args); consoleLogger.error(msg, ...args);
}, },
warn: (msg: string, ...args: any[]) => { warn: (msg: string, ...args: any[]) => {
fileLogger.warn(msg, ...args);
consoleLogger.warn(msg, ...args); consoleLogger.warn(msg, ...args);
}, },
}; };

BIN
index.exe

Binary file not shown.