Fix Header/Grouper for Log Messages using deprecated SDKs

Fix #85
This commit is contained in:
Klaas van Schelven
2025-04-24 20:59:16 +02:00
parent 82bae6f24c
commit cddd4f2c02
2 changed files with 9 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ Various fixes and improvements:
* When is the `email_system_warning` shown? change & document * When is the `email_system_warning` shown? change & document
* Snappea foreman: on catastrophic errors, wait for workers, see 9b6fbe523f3c * Snappea foreman: on catastrophic errors, wait for workers, see 9b6fbe523f3c
* Explain tailwind usage during development & vendoring step, see 5c0e45a16db2 * Explain tailwind usage during development & vendoring step, see 5c0e45a16db2
* Fix Header/Grouper for Log Messages using deprecated SDKs (See #85)
## 1.5.0 (14 April 2025) ## 1.5.0 (14 April 2025)

View File

@@ -61,8 +61,16 @@ def get_exception_type_and_value_for_logmessage(data):
message = strip( message = strip(
get_path(data, "logentry", "message") get_path(data, "logentry", "message")
or get_path(data, "logentry", "formatted") or get_path(data, "logentry", "formatted")
# top-level "message" (deprecated, but still used by some SDKs, with a dict as with "logentry")
or get_path(data, "message", "message")
or get_path(data, "message", "formatted")
) )
if not message and isinstance(data.get("message"), str):
# top-level "message" as a string (even more deprecated, but still used by some SDKs)
message = data.get("message")
if message: if message:
return "Log Message", message.splitlines()[0][:1024] return "Log Message", message.splitlines()[0][:1024]