Skip to content

Commit 7105b56

Browse files
authored
Merge pull request #352 from csu333/fix/webhook-log-large-payloads
Only log full webhook payload when small
2 parents dc0646d + 3246b67 commit 7105b56

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

wmiau.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,15 @@ func sendToUserWebHookWithHmac(webhookurl string, path string, jsonData []byte,
183183
"instanceName": instance_name,
184184
}
185185

186-
log.Debug().Interface("webhookData", data).Msg("Data being sent to webhook")
186+
if len(jsonData) > 8192 {
187+
log.Debug().
188+
Str("userID", userID).
189+
Str("instanceName", instance_name).
190+
Int("jsonDataBytes", len(jsonData)).
191+
Msg("Data being sent to webhook")
192+
} else {
193+
log.Debug().Interface("webhookData", data).Msg("Data being sent to webhook")
194+
}
187195

188196
if webhookurl != "" {
189197
log.Info().Str("url", webhookurl).Msg("Calling user webhook")

0 commit comments

Comments
 (0)