relay/src/log.ts
Corban-Lee Jones 0dd928b8f4
Some checks failed
Build / build (push) Failing after 54s
working on logger
2025-05-05 23:39:22 +01:00

18 lines
518 B
TypeScript

import winston from "winston";
const { combine, timestamp, json, printf } = winston.format;
const timestampFormat = "YYYY-MM-DD HH:mm:ss";
export const logger = winston.createLogger({
format: combine(
timestamp({ format: timestampFormat }),
json(),
printf(({ timestamp, level, message, ...data }) => {
const response = { level, message, data };
return JSON.stringify(response);
})
),
transports: [
new winston.transports.Console()
]
});