-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog4js.config.ts
44 lines (42 loc) · 1.12 KB
/
log4js.config.ts
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
35
36
37
38
39
40
41
42
43
44
import {Configuration} from "log4js";
import path from "path";
const dirName = path.resolve(__dirname, './log');
export const log4jsConfig: Configuration = {
appenders: {
console: {
type: 'console',
layout: {
type: 'pattern',
pattern: '%[[%d] %p %c -%] %m%n%f %l %o%n%s'
},
},
application: {
type: 'dateFile',
filename: path.resolve(dirName, 'application.log'),
pattern: '.yyyyMMdd-hhmmss',
keepFileExt: true,
numBackups: 5
},
access: {
type: 'dateFile',
filename: path.resolve(dirName, 'access.log'),
pattern: '.yyyyMMdd-hhmmss',
keepFileExt: true,
numBackups: 5
}
},
categories: {
default: {
appenders: ['console'],
level: 'ALL',
},
application: {
appenders: ['console', 'application'],
level: 'INFO'
},
access: {
appenders: ['console', 'access'],
level: 'INFO',
},
}
};