This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
skynet-webportal/packages/siaviewnode-server/src/logger.ts

26 lines
622 B
TypeScript
Raw Normal View History

2020-01-31 20:18:58 +00:00
import { createLogger, format, transports } from 'winston';
const { combine, timestamp, prettyPrint } = format;
2020-02-17 14:34:34 +00:00
export default createLogger({
2020-01-31 20:18:58 +00:00
format: combine(
timestamp(),
prettyPrint(),
),
transports: [
new transports.Console(),
new transports.File({
filename: './error.log',
level: 'error',
maxsize: 5242880,
maxFiles: 2
}),
new transports.File({
filename: './info.log',
level: 'info',
maxsize: 5242880,
maxFiles: 5
}),
],
exitOnError: false,
2020-02-17 14:34:34 +00:00
});