@@ -13,89 +13,89 @@ const basePinoOptions = {
13
13
@Module ( {
14
14
imports : [
15
15
LoggerModule . forRoot ( {
16
- pinoHttp : {
17
- timestamp : ( ) => `,"timestamp":"${ new Date ( Date . now ( ) ) . toISOString ( ) } "` ,
18
- name : "ultimate-nest" ,
19
- customProps : ( ) => ( {
20
- context : "HTTP" ,
21
- } ) ,
22
- serializers : {
23
- req ( request : {
16
+ pinoHttp : {
17
+ timestamp : ( ) => `,"timestamp":"${ new Date ( Date . now ( ) ) . toISOString ( ) } "` ,
18
+ name : "ultimate-nest" ,
19
+ customProps : ( ) => ( {
20
+ context : "HTTP" ,
21
+ } ) ,
22
+ serializers : {
23
+ req ( request : {
24
+ body : Record < string , any > ;
25
+ raw : {
24
26
body : Record < string , any > ;
25
- raw : {
26
- body : Record < string , any > ;
27
- } ;
28
- } ) {
29
- request . body = request . raw . body ;
27
+ } ;
28
+ } ) {
29
+ request . body = request . raw . body ;
30
30
31
- return request ;
32
- } ,
33
- } ,
34
- redact : {
35
- paths : redactFields ,
36
- censor : "**GDPR COMPLIANT**" ,
31
+ return request ;
37
32
} ,
38
- transport : true
39
- ? {
40
- targets : [
41
- {
42
- target : "pino/file" ,
43
- level : "info" , // log only errors to file
44
- options : {
45
- ...basePinoOptions ,
46
- destination : "logs/info.log" ,
47
- mkdir : true ,
48
- sync : false ,
49
- } ,
33
+ } ,
34
+ redact : {
35
+ paths : redactFields ,
36
+ censor : "**GDPR COMPLIANT**" ,
37
+ } ,
38
+ transport : true
39
+ ? {
40
+ targets : [
41
+ {
42
+ target : "pino/file" ,
43
+ level : "info" , // log only errors to file
44
+ options : {
45
+ ...basePinoOptions ,
46
+ destination : "logs/info.log" ,
47
+ mkdir : true ,
48
+ sync : false ,
50
49
} ,
51
- {
52
- target : "pino/file" ,
53
- level : "error" , // log only errors to file
54
- options : {
55
- ... basePinoOptions ,
56
- destination : "logs/error.log" ,
57
- mkdir : true ,
58
- sync : false ,
59
- } ,
50
+ } ,
51
+ {
52
+ target : "pino/ file" ,
53
+ level : "error" , // log only errors to file
54
+ options : {
55
+ ... basePinoOptions ,
56
+ destination : "logs/error.log" ,
57
+ mkdir : true ,
58
+ sync : false ,
60
59
} ,
61
- ] ,
62
- }
63
- : {
64
- targets : [
65
- {
66
- target : "pino-pretty" ,
67
- level : "info" , // log only info and above to console
68
- options : {
69
- ... basePinoOptions ,
70
- colorize : true ,
71
- } ,
60
+ } ,
61
+ ] ,
62
+ }
63
+ : {
64
+ targets : [
65
+ {
66
+ target : "pino-pretty" ,
67
+ level : "info" , // log only info and above to console
68
+ options : {
69
+ ... basePinoOptions ,
70
+ colorize : true ,
72
71
} ,
73
- {
74
- target : "pino/file" ,
75
- level : "info" , // log only errors to file
76
- options : {
77
- ... basePinoOptions ,
78
- destination : "logs/info.log" ,
79
- mkdir : true ,
80
- sync : false ,
81
- } ,
72
+ } ,
73
+ {
74
+ target : "pino/ file" ,
75
+ level : "info" , // log only errors to file
76
+ options : {
77
+ ... basePinoOptions ,
78
+ destination : "logs/info.log" ,
79
+ mkdir : true ,
80
+ sync : false ,
82
81
} ,
83
- {
84
- target : "pino/file" ,
85
- level : "error" , // log only errors to file
86
- options : {
87
- ... basePinoOptions ,
88
- destination : "logs/error.log" ,
89
- mkdir : true ,
90
- sync : false ,
91
- } ,
82
+ } ,
83
+ {
84
+ target : "pino/ file" ,
85
+ level : "error" , // log only errors to file
86
+ options : {
87
+ ... basePinoOptions ,
88
+ destination : "logs/error.log" ,
89
+ mkdir : true ,
90
+ sync : false ,
92
91
} ,
93
- ] ,
94
- } ,
95
- } ,
96
- exclude : [ { method : RequestMethod . ALL , path : "doc" } ] ,
92
+ } ,
93
+ ] ,
94
+ } ,
95
+ } ,
96
+ exclude : [ { method : RequestMethod . ALL , path : "doc" } ] ,
97
97
98
- } ) ,
98
+ } ) ,
99
99
] ,
100
100
exports : [ LoggerModule ] ,
101
101
} )
0 commit comments