const winston = require('winston');

const { printf, timestamp, combine } = winston.format;

const chatFormat = printf((info) =>
    `${info.timestamp} [${info.level}]: ChatId ${info.chatId}. "${
        info.message
    }"`);

const logger = winston.createLogger({
    level: 'info',
    format: combine(timestamp(), chatFormat),
    transports: [
        new winston.transports.File({ filename: 'error.log', level: 'info' })
    ]
});

module.exports = { logger };

@@ -125,16 +125,38 @@
 ) =%3E%0A   
+ info.chatId%0A        ?
  %60$%7Binfo
@@ -210,25 +210,16 @@
 Id%7D. %22$%7B
-%0A        
 info.mes
@@ -226,16 +226,43 @@
 sage
+%7D%22%60
 %0A    
-%7D%22%60
+    : JSON.stringify(info)%0A
 );%0A%0A

Allow pass random objects to logger