IO-2998 remove graylog and additional erroneous console logs.

This commit is contained in:
Patrick Fic
2024-10-24 12:18:39 -07:00
parent 2d3c13c587
commit 8dc1f7e08f
13 changed files with 78 additions and 73 deletions

View File

@@ -47,7 +47,7 @@ exports.receive = async (req, res) => {
//Found a bodyshop - should always happen.
if (response.bodyshops[0].conversations.length === 0) {
//No conversation Found, create one.
console.log("[SMS Receive] No conversation found. Creating one.");
//console.log("[SMS Receive] No conversation found. Creating one.");
newMessage.conversation = {
data: {
bodyshopid: response.bodyshops[0].id,
@@ -56,7 +56,7 @@ exports.receive = async (req, res) => {
};
} else if (response.bodyshops[0].conversations.length === 1) {
//Just add it to the conversation
console.log("[SMS Receive] Conversation found. Added ID.");
//console.log("[SMS Receive] Conversation found. Added ID.");
newMessage.conversationid = response.bodyshops[0].conversations[0].id;
} else {
//We should never get here.
@@ -123,7 +123,14 @@ exports.receive = async (req, res) => {
}
}
} catch (e1) {
console.log("e1", e1);
logger.log("sms-inbound-error", "ERROR", "api", null, {
msid: req.body.SmsMessageSid,
text: req.body.Body,
image: !!req.body.MediaUrl0,
image_path: generateMediaArray(req.body),
messagingServiceSid: req.body.MessagingServiceSid,
error: e1
});
res.sendStatus(500).json(e1);
}
}