winston logger
-
[winston] How to log as daily rotate fileBackend/NodeJS 2019. 12. 20. 17:14
winston으로 날짜별 파일에 로그 기록하는 방법 사용 모듈: winston-daily-rotate-file timestamp 커스텀: [node.js] - [winston] How to customize timestamp format. (to local timezone) import moment from "moment"; const fecha = require("fecha"); const winston = require("winston"); require("winston-daily-rotate-file"); const format = winston.format; const { combine, label, prettyPrint, colorize } = format; // It's customized t..
-
How to use Winston to log node application with telegram.Backend/NodeJS 2019. 12. 19. 18:47
I use winston-telegram How get telegram bot token & chatId : LINK Example: const wstlogger = require("winston"); const TelegramLogger = require("winston-telegram"); wstlogger.add(new TelegramLogger( { token: process.env.TELBOT_TOKEN, chatId: process.env.TELBOT_CHATID, level: "warn", unique: true, formatMessage: function (options: any) { let message = options.message; if (options.level === "warn"..