@@ -20,10 +20,10 @@ interface LogInfo {
20
20
severity : string ;
21
21
}
22
22
23
- export class SlogerrTransport extends TransportStream {
23
+ export class DhilogTransport extends TransportStream {
24
24
private readonly httpService : HttpService ;
25
25
private readonly configService : ConfigService ;
26
- private readonly logger = new Logger ( SlogerrTransport . name ) ;
26
+ private readonly logger = new Logger ( DhilogTransport . name ) ;
27
27
28
28
constructor ( options : CustomTransportOptions ) {
29
29
super ( options ) ;
@@ -32,14 +32,14 @@ export class SlogerrTransport extends TransportStream {
32
32
}
33
33
34
34
async log ( info : LogInfo , callback : ( ) => void ) : Promise < void > {
35
- const allowedLevels = ( this . configService . get < string > ( 'SLOGGER_LOG_LEVEL ' ) || 'error' )
35
+ const allowedLevels = ( this . configService . get < string > ( 'DHILOG_LOG_LEVEL ' ) || 'error' )
36
36
. split ( ',' )
37
37
. map ( ( level ) => level . trim ( ) ) ;
38
- const logType = this . configService . get < string > ( 'SLOGGER_LOG_TYPE ' ) || 'Exceptions' ;
38
+ const logType = this . configService . get < string > ( 'DHILOG_LOG_TYPE ' ) || 'Exceptions' ;
39
39
40
40
if ( allowedLevels . includes ( info . level ) ) {
41
- const apiEndpoint = this . configService . get < string > ( 'SLOGERR_API_ENDPOINT ' ) ;
42
- const apiKey = this . configService . get < string > ( 'SLOGERR_API_TOKEN ' ) ;
41
+ const apiEndpoint = this . configService . get < string > ( 'DHILOG_API_ENDPOINT ' ) ;
42
+ const apiKey = this . configService . get < string > ( 'DHILOG_API_TOKEN ' ) ;
43
43
44
44
this . logger . log ( `Log Info: ${ stringify ( info ) } ` ) ;
45
45
@@ -67,13 +67,13 @@ export class SlogerrTransport extends TransportStream {
67
67
68
68
if ( response . status !== 200 ) {
69
69
this . logger . warn (
70
- `Failed to send log to Slogerr . Status: ${ response . status } , Message: ${ response . statusText } ` ,
70
+ `Failed to send log to Dhilog . Status: ${ response . status } , Message: ${ response . statusText } ` ,
71
71
) ;
72
72
} else {
73
- this . logger . log ( 'Error log successfully sent to Slogerr ' , response ) ;
73
+ this . logger . log ( 'Error log successfully sent to Dhilog ' , response ) ;
74
74
}
75
75
} catch ( error ) {
76
- this . logger . warn ( 'Failed to send log to Slogerr ' , error . message ) ;
76
+ this . logger . warn ( 'Failed to send log to Dhilog ' , error . message ) ;
77
77
}
78
78
}
79
79
0 commit comments