forked from openiap/opencore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.ts
More file actions
34 lines (33 loc) · 1.05 KB
/
Copy pathLogger.ts
File metadata and controls
34 lines (33 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as winston from "winston";
export class Logger {
static instanse:winston.Logger = null;
static configure(): winston.Logger {
var options: any = {
// file: {
// level: "info",
// filename: `${__dirname}/logs/app.log`,
// handleExceptions: false,
// json: true,
// maxsize: 5242880, // 5MB
// maxFiles: 5,
// colorize: false,
// },
console: {
level: "silly",
handleExceptions: false,
json: false,
colorize: true
},
};
const logger: winston.Logger = winston.createLogger({
format: winston.format.json(),
defaultMeta: { service: "openflownodered" },
transports: [
// new winston.transports.File(options.file),
new winston.transports.Console(options.console)
]
});
Logger.instanse = logger;
return logger;
}
}