|
|
@ -20,6 +20,7 @@ import ( |
|
|
|
"bytes" |
|
|
|
"bytes" |
|
|
|
"encoding/xml" |
|
|
|
"encoding/xml" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"net" |
|
|
|
"net/url" |
|
|
|
"net/url" |
|
|
|
"path" |
|
|
|
"path" |
|
|
|
"sync" |
|
|
|
"sync" |
|
|
@ -308,6 +309,14 @@ func loadAllQueueTargets() (map[string]*logrus.Logger, error) { |
|
|
|
// Using accountID we can now initialize a new AMQP logrus instance.
|
|
|
|
// Using accountID we can now initialize a new AMQP logrus instance.
|
|
|
|
amqpLog, err := newAMQPNotify(accountID) |
|
|
|
amqpLog, err := newAMQPNotify(accountID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
// Encapsulate network error to be more informative.
|
|
|
|
|
|
|
|
if _, ok := err.(net.Error); ok { |
|
|
|
|
|
|
|
return nil, &net.OpError{ |
|
|
|
|
|
|
|
Op: "Connecting to " + queueARN, |
|
|
|
|
|
|
|
Net: "tcp", |
|
|
|
|
|
|
|
Err: err, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
queueTargets[queueARN] = amqpLog |
|
|
|
queueTargets[queueARN] = amqpLog |
|
|
@ -327,6 +336,14 @@ func loadAllQueueTargets() (map[string]*logrus.Logger, error) { |
|
|
|
// Using accountID we can now initialize a new Redis logrus instance.
|
|
|
|
// Using accountID we can now initialize a new Redis logrus instance.
|
|
|
|
redisLog, err := newRedisNotify(accountID) |
|
|
|
redisLog, err := newRedisNotify(accountID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
// Encapsulate network error to be more informative.
|
|
|
|
|
|
|
|
if _, ok := err.(net.Error); ok { |
|
|
|
|
|
|
|
return nil, &net.OpError{ |
|
|
|
|
|
|
|
Op: "Connecting to " + queueARN, |
|
|
|
|
|
|
|
Net: "tcp", |
|
|
|
|
|
|
|
Err: err, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
queueTargets[queueARN] = redisLog |
|
|
|
queueTargets[queueARN] = redisLog |
|
|
@ -345,6 +362,13 @@ func loadAllQueueTargets() (map[string]*logrus.Logger, error) { |
|
|
|
// Using accountID we can now initialize a new ElasticSearch logrus instance.
|
|
|
|
// Using accountID we can now initialize a new ElasticSearch logrus instance.
|
|
|
|
elasticLog, err := newElasticNotify(accountID) |
|
|
|
elasticLog, err := newElasticNotify(accountID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
// Encapsulate network error to be more informative.
|
|
|
|
|
|
|
|
if _, ok := err.(net.Error); ok { |
|
|
|
|
|
|
|
return nil, &net.OpError{ |
|
|
|
|
|
|
|
Op: "Connecting to " + queueARN, Net: "tcp", |
|
|
|
|
|
|
|
Err: err, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
queueTargets[queueARN] = elasticLog |
|
|
|
queueTargets[queueARN] = elasticLog |
|
|
|