oneuptime/CommonServer/Utils/Logger.ts

15 lines
369 B
TypeScript
Raw Normal View History

2022-06-29 23:09:29 +00:00
import { createLogger, Logger, transports, format } from 'winston';
2022-04-08 12:54:03 +00:00
2022-06-29 23:09:29 +00:00
const { combine, timestamp, errors, prettyPrint } = format;
2022-04-08 12:54:03 +00:00
2022-05-31 13:57:15 +00:00
const logger: Logger = createLogger({
2022-05-25 21:41:30 +00:00
format: combine(
errors({ stack: true }), // <-- use errors format
2022-06-29 23:09:29 +00:00
timestamp(),
prettyPrint()
2022-06-29 23:13:28 +00:00
),
2022-05-25 21:41:30 +00:00
transports: [new transports.Console()],
2022-04-08 12:54:03 +00:00
});
2022-05-31 13:08:32 +00:00
export default logger;