From 77b8b50526fe129817b948aed36df4b01b2624c4 Mon Sep 17 00:00:00 2001 From: Michael Haufe Date: Tue, 30 Jul 2024 12:58:28 -0500 Subject: [PATCH] chore: Refactor Slack bot logging for improved debugging (#296) --- server/api/slack-bot/index.post.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/server/api/slack-bot/index.post.ts b/server/api/slack-bot/index.post.ts index 96978e13..c6c94970 100644 --- a/server/api/slack-bot/index.post.ts +++ b/server/api/slack-bot/index.post.ts @@ -1,9 +1,6 @@ import { z } from "zod" import crypto from 'crypto' import { WebClient } from "@slack/web-api" -import appInsights from 'applicationinsights'; - -const ai = appInsights.defaultClient const bodySchema = z.object({ type: z.string(), @@ -101,14 +98,8 @@ export default defineEventHandler(async (event) => { message: JSON.stringify(body.error.errors) }) - ai.trackTrace({ - message: `SlackBotMessage Headers: ${JSON.stringify(headers)}` - }) - ai.trackTrace({ - message: `SlackBotMessage rawBody: ${rawBody}` - }) - - ai.flush() + console.log('SlackBotMessage Headers:', JSON.stringify(headers)) + console.log('SlackBotMessage rawBody:', { rawBody }) if (!isValidSlackRequest(headers, rawBody)) throw createError({