Implement logger on back
This commit is contained in:
parent
c573e9fbaf
commit
6a195be814
17 changed files with 260 additions and 76 deletions
16
back/src/Services/Logger.ts
Normal file
16
back/src/Services/Logger.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import * as winston from "winston";
|
||||
|
||||
const logger = winston.createLogger({
|
||||
transports: [
|
||||
new winston.transports.Console({
|
||||
format: winston.format.combine(
|
||||
winston.format.colorize(),
|
||||
winston.format.timestamp(),
|
||||
winston.format.align(),
|
||||
winston.format.printf((info) => `${info.timestamp} ${info.level}: ${info.message}`)
|
||||
),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
export default logger;
|
Loading…
Add table
Add a link
Reference in a new issue