File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ else {
42
42
) ;
43
43
}
44
44
45
+ logger . on ( "warn" , ( error ) => {
46
+ console . log ( error ) ;
47
+ } ) ;
48
+
45
49
logger . on ( "error" , ( error ) => {
46
50
console . log ( error ) ;
47
51
} ) ;
@@ -61,7 +65,7 @@ pm2.launchBus(function (err, bus) {
61
65
if ( err ) return console . error ( err ) ;
62
66
63
67
bus . on ( "log:out" , function ( log : logType ) {
64
- if ( log . process . name !== "PM2-LOGSTASH" ) {
68
+ if ( ! [ "PM2-LOGSTASH" , "LOGSTASH-SERVER" ] . includes ( log . process . name ) ) {
65
69
log . data = stripAnsi ( log . data ) ; // Removing Ansi Color Codes
66
70
//Some times errors are logged in normal output
67
71
let errorFlag = log . data . toUpperCase ( ) . indexOf ( "ERROR" ) != - 1 ;
@@ -83,7 +87,7 @@ pm2.launchBus(function (err, bus) {
83
87
} ) ;
84
88
85
89
bus . on ( "log:err" , function ( log : logType ) {
86
- if ( log . process . name !== "PM2-LOGSTASH" ) {
90
+ if ( ! [ "PM2-LOGSTASH" , "LOGSTASH-SERVER" ] . includes ( log . process . name ) ) {
87
91
log . data = stripAnsi ( log . data ) ; // Removing Ansi Color Codes
88
92
var message = {
89
93
timestamp : new Date ( log . at ) . toISOString ( ) ,
Original file line number Diff line number Diff line change @@ -24,14 +24,17 @@ else {
24
24
rejectUnauthorized : false , //Does Not Work Without This Apparently
25
25
} ) ) ;
26
26
}
27
+ logger . on ( "warn" , ( error ) => {
28
+ console . log ( error ) ;
29
+ } ) ;
27
30
logger . on ( "error" , ( error ) => {
28
31
console . log ( error ) ;
29
32
} ) ;
30
33
pm2 . launchBus ( function ( err , bus ) {
31
34
if ( err )
32
35
return console . error ( err ) ;
33
36
bus . on ( "log:out" , function ( log ) {
34
- if ( log . process . name !== "PM2-LOGSTASH" ) {
37
+ if ( ! [ "PM2-LOGSTASH" , "LOGSTASH-SERVER" ] . includes ( log . process . name ) ) {
35
38
log . data = stripAnsi ( log . data ) ; // Removing Ansi Color Codes
36
39
//Some times errors are logged in normal output
37
40
let errorFlag = log . data . toUpperCase ( ) . indexOf ( "ERROR" ) != - 1 ;
@@ -52,7 +55,7 @@ pm2.launchBus(function (err, bus) {
52
55
}
53
56
} ) ;
54
57
bus . on ( "log:err" , function ( log ) {
55
- if ( log . process . name !== "PM2-LOGSTASH" ) {
58
+ if ( ! [ "PM2-LOGSTASH" , "LOGSTASH-SERVER" ] . includes ( log . process . name ) ) {
56
59
log . data = stripAnsi ( log . data ) ; // Removing Ansi Color Codes
57
60
var message = {
58
61
timestamp : new Date ( log . at ) . toISOString ( ) ,
You can’t perform that action at this time.
0 commit comments