We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f54872 commit fbe3957Copy full SHA for fbe3957
sentry_sdk/integrations/logging.py
@@ -134,11 +134,19 @@ def _logging_to_event_level(levelname):
134
135
def _extra_from_record(record):
136
# type: (LogRecord) -> Dict[str, None]
137
- return {
138
- k: v
139
- for k, v in vars(record).items()
140
- if k not in COMMON_RECORD_ATTRS and not k.startswith("_")
141
- }
+ extra = getattr(record, 'data', None)
+ if not isinstance(extra, dict):
+ if extra:
+ extra = {'data': extra}
+ else:
142
+ extra = {}
143
+
144
+ for k, v in vars(record).items():
145
+ if k in COMMON_RECORD_ATTRS or k.startswith("_"):
146
+ continue
147
+ extra[k] = v
148
149
+ return extra
150
151
152
class EventHandler(logging.Handler, object):
0 commit comments