feat(logging): add logger
This commit is contained in:
parent
7c84025f3c
commit
aae85cd767
15 changed files with 240 additions and 17 deletions
22
src/utils/logger.ts
Normal file
22
src/utils/logger.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import winston from 'winston';
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: 'info',
|
||||
transports: [
|
||||
new winston.transports.Console({
|
||||
format: winston.format.combine(
|
||||
winston.format.colorize(),
|
||||
winston.format.simple(),
|
||||
),
|
||||
}),
|
||||
new winston.transports.File({
|
||||
filename: 'app.log',
|
||||
format: winston.format.combine(
|
||||
winston.format.timestamp(),
|
||||
winston.format.json(),
|
||||
),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
export default logger;
|
Loading…
Add table
Add a link
Reference in a new issue