We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
logging breadcrumb collection time is incorrect

![sentry](https://user-images.githubusercontent.com/28345280/61774444-71f0a800-ae29-11e9-8074-f3c88154b432.png)

I found the breadcrumbs timestamp converted to the local time zone
datetime.datetime.fromtimestamp(record.created)

> ```python
> # /sentry_sdk/integrations/logging.py:90
> def _breadcrumb_from_record(record):
>     # type: (LogRecord) -> Dict[str, Any]
>     return {
>         "ty": "log",
>         "level": _logging_to_event_level(record.levelname),
>         "category": record.name,
>         "message": record.message,
>         "timestamp": datetime.datetime.fromtimestamp(record.created),
>         "data": _extra_from_record(record),
>     }
> ```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sentry_sdk/integrations/logging.py`
Content:
```
1 from __future__ import absolute_import
2 
3 import logging
4 import datetime
5 
6 from sentry_sdk.hub import Hub
7 from sentry_sdk.utils import (
8     to_string,
9     event_from_exception,
10     current_stacktrace,
11     capture_internal_exceptions,
12 )
13 from sentry_sdk.integrations import Integration
14 from sentry_sdk._compat import iteritems
15 
16 from sentry_sdk._types import MYPY
17 
18 if MYPY:
19     from logging import LogRecord
20     from typing import Any
21     from typing import Dict
22     from typing import Optional
23 
24 DEFAULT_LEVEL = logging.INFO
25 DEFAULT_EVENT_LEVEL = logging.ERROR
26 
27 _IGNORED_LOGGERS = set(["sentry_sdk.errors"])
28 
29 
30 def ignore_logger(name):
31     # type: (str) -> None
32     """This disables recording (both in breadcrumbs and as events) calls to
33     a logger of a specific name.  Among other uses, many of our integrations
34     use this to prevent their actions being recorded as breadcrumbs. Exposed
35     to users as a way to quiet spammy loggers.
36     """
37     _IGNORED_LOGGERS.add(name)
38 
39 
40 class LoggingIntegration(Integration):
41     identifier = "logging"
42 
43     def __init__(self, level=DEFAULT_LEVEL, event_level=DEFAULT_EVENT_LEVEL):
44         # type: (Optional[int], Optional[int]) -> None
45         self._handler = None
46         self._breadcrumb_handler = None
47 
48         if level is not None:
49             self._breadcrumb_handler = BreadcrumbHandler(level=level)
50 
51         if event_level is not None:
52             self._handler = EventHandler(level=event_level)
53 
54     def _handle_record(self, record):
55         # type: (LogRecord) -> None
56         if self._handler is not None and record.levelno >= self._handler.level:
57             self._handler.handle(record)
58 
59         if (
60             self._breadcrumb_handler is not None
61             and record.levelno >= self._breadcrumb_handler.level
62         ):
63             self._breadcrumb_handler.handle(record)
64 
65     @staticmethod
66     def setup_once():
67         # type: () -> None
68         old_callhandlers = logging.Logger.callHandlers  # type: ignore
69 
70         def sentry_patched_callhandlers(self, record):
71             # type: (Any, LogRecord) -> Any
72             try:
73                 return old_callhandlers(self, record)
74             finally:
75                 # This check is done twice, once also here before we even get
76                 # the integration.  Otherwise we have a high chance of getting
77                 # into a recursion error when the integration is resolved
78                 # (this also is slower).
79                 if record.name not in _IGNORED_LOGGERS:
80                     integration = Hub.current.get_integration(LoggingIntegration)
81                     if integration is not None:
82                         integration._handle_record(record)
83 
84         logging.Logger.callHandlers = sentry_patched_callhandlers  # type: ignore
85 
86 
87 def _can_record(record):
88     # type: (LogRecord) -> bool
89     return record.name not in _IGNORED_LOGGERS
90 
91 
92 def _breadcrumb_from_record(record):
93     # type: (LogRecord) -> Dict[str, Any]
94     return {
95         "ty": "log",
96         "level": _logging_to_event_level(record.levelname),
97         "category": record.name,
98         "message": record.message,
99         "timestamp": datetime.datetime.fromtimestamp(record.created),
100         "data": _extra_from_record(record),
101     }
102 
103 
104 def _logging_to_event_level(levelname):
105     # type: (str) -> str
106     return {"critical": "fatal"}.get(levelname.lower(), levelname.lower())
107 
108 
109 COMMON_RECORD_ATTRS = frozenset(
110     (
111         "args",
112         "created",
113         "exc_info",
114         "exc_text",
115         "filename",
116         "funcName",
117         "levelname",
118         "levelno",
119         "linenno",
120         "lineno",
121         "message",
122         "module",
123         "msecs",
124         "msg",
125         "name",
126         "pathname",
127         "process",
128         "processName",
129         "relativeCreated",
130         "stack",
131         "tags",
132         "thread",
133         "threadName",
134     )
135 )
136 
137 
138 def _extra_from_record(record):
139     # type: (LogRecord) -> Dict[str, None]
140     return {
141         k: v
142         for k, v in iteritems(vars(record))
143         if k not in COMMON_RECORD_ATTRS
144         and (not isinstance(k, str) or not k.startswith("_"))
145     }
146 
147 
148 class EventHandler(logging.Handler, object):
149     def emit(self, record):
150         # type: (LogRecord) -> Any
151         with capture_internal_exceptions():
152             self.format(record)
153             return self._emit(record)
154 
155     def _emit(self, record):
156         # type: (LogRecord) -> None
157         if not _can_record(record):
158             return
159 
160         hub = Hub.current
161         if hub.client is None:
162             return
163 
164         client_options = hub.client.options
165 
166         # exc_info might be None or (None, None, None)
167         if record.exc_info is not None and record.exc_info[0] is not None:
168             event, hint = event_from_exception(
169                 record.exc_info,
170                 client_options=client_options,
171                 mechanism={"type": "logging", "handled": True},
172             )
173         elif record.exc_info and record.exc_info[0] is None:
174             event = {}
175             hint = {}
176             with capture_internal_exceptions():
177                 event["threads"] = {
178                     "values": [
179                         {
180                             "stacktrace": current_stacktrace(
181                                 client_options["with_locals"]
182                             ),
183                             "crashed": False,
184                             "current": True,
185                         }
186                     ]
187                 }
188         else:
189             event = {}
190             hint = {}
191 
192         hint["log_record"] = record
193 
194         event["level"] = _logging_to_event_level(record.levelname)
195         event["logger"] = record.name
196         event["logentry"] = {"message": to_string(record.msg), "params": record.args}
197         event["extra"] = _extra_from_record(record)
198 
199         hub.capture_event(event, hint=hint)
200 
201 
202 # Legacy name
203 SentryHandler = EventHandler
204 
205 
206 class BreadcrumbHandler(logging.Handler, object):
207     def emit(self, record):
208         # type: (LogRecord) -> Any
209         with capture_internal_exceptions():
210             self.format(record)
211             return self._emit(record)
212 
213     def _emit(self, record):
214         # type: (LogRecord) -> None
215         if not _can_record(record):
216             return
217 
218         Hub.current.add_breadcrumb(
219             _breadcrumb_from_record(record), hint={"log_record": record}
220         )
221
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/sentry_sdk/integrations/logging.py b/sentry_sdk/integrations/logging.py
--- a/sentry_sdk/integrations/logging.py
+++ b/sentry_sdk/integrations/logging.py
@@ -96,7 +96,7 @@
         "level": _logging_to_event_level(record.levelname),
         "category": record.name,
         "message": record.message,
-        "timestamp": datetime.datetime.fromtimestamp(record.created),
+        "timestamp": datetime.datetime.utcfromtimestamp(record.created),
         "data": _extra_from_record(record),
     }

{"golden_diff": "diff --git a/sentry_sdk/integrations/logging.py b/sentry_sdk/integrations/logging.py\n--- a/sentry_sdk/integrations/logging.py\n+++ b/sentry_sdk/integrations/logging.py\n@@ -96,7 +96,7 @@\n         \"level\": _logging_to_event_level(record.levelname),\n         \"category\": record.name,\n         \"message\": record.message,\n-        \"timestamp\": datetime.datetime.fromtimestamp(record.created),\n+        \"timestamp\": datetime.datetime.utcfromtimestamp(record.created),\n         \"data\": _extra_from_record(record),\n     }\n", "issue": "logging breadcrumb collection time is incorrect\n\r\n![sentry](https://user-images.githubusercontent.com/28345280/61774444-71f0a800-ae29-11e9-8074-f3c88154b432.png)\r\n\r\nI found the breadcrumbs timestamp converted to the local time zone\r\ndatetime.datetime.fromtimestamp(record.created)\r\n\r\n> ```python\r\n> # /sentry_sdk/integrations/logging.py:90\r\n> def _breadcrumb_from_record(record):\r\n>     # type: (LogRecord) -> Dict[str, Any]\r\n>     return {\r\n>         \"ty\": \"log\",\r\n>         \"level\": _logging_to_event_level(record.levelname),\r\n>         \"category\": record.name,\r\n>         \"message\": record.message,\r\n>         \"timestamp\": datetime.datetime.fromtimestamp(record.created),\r\n>         \"data\": _extra_from_record(record),\r\n>     }\r\n> ```\n", "before_files": [{"content": "from __future__ import absolute_import\n\nimport logging\nimport datetime\n\nfrom sentry_sdk.hub import Hub\nfrom sentry_sdk.utils import (\n    to_string,\n    event_from_exception,\n    current_stacktrace,\n    capture_internal_exceptions,\n)\nfrom sentry_sdk.integrations import Integration\nfrom sentry_sdk._compat import iteritems\n\nfrom sentry_sdk._types import MYPY\n\nif MYPY:\n    from logging import LogRecord\n    from typing import Any\n    from typing import Dict\n    from typing import Optional\n\nDEFAULT_LEVEL = logging.INFO\nDEFAULT_EVENT_LEVEL = logging.ERROR\n\n_IGNORED_LOGGERS = set([\"sentry_sdk.errors\"])\n\n\ndef ignore_logger(name):\n    # type: (str) -> None\n    \"\"\"This disables recording (both in breadcrumbs and as events) calls to\n    a logger of a specific name.  Among other uses, many of our integrations\n    use this to prevent their actions being recorded as breadcrumbs. Exposed\n    to users as a way to quiet spammy loggers.\n    \"\"\"\n    _IGNORED_LOGGERS.add(name)\n\n\nclass LoggingIntegration(Integration):\n    identifier = \"logging\"\n\n    def __init__(self, level=DEFAULT_LEVEL, event_level=DEFAULT_EVENT_LEVEL):\n        # type: (Optional[int], Optional[int]) -> None\n        self._handler = None\n        self._breadcrumb_handler = None\n\n        if level is not None:\n            self._breadcrumb_handler = BreadcrumbHandler(level=level)\n\n        if event_level is not None:\n            self._handler = EventHandler(level=event_level)\n\n    def _handle_record(self, record):\n        # type: (LogRecord) -> None\n        if self._handler is not None and record.levelno >= self._handler.level:\n            self._handler.handle(record)\n\n        if (\n            self._breadcrumb_handler is not None\n            and record.levelno >= self._breadcrumb_handler.level\n        ):\n            self._breadcrumb_handler.handle(record)\n\n    @staticmethod\n    def setup_once():\n        # type: () -> None\n        old_callhandlers = logging.Logger.callHandlers  # type: ignore\n\n        def sentry_patched_callhandlers(self, record):\n            # type: (Any, LogRecord) -> Any\n            try:\n                return old_callhandlers(self, record)\n            finally:\n                # This check is done twice, once also here before we even get\n                # the integration.  Otherwise we have a high chance of getting\n                # into a recursion error when the integration is resolved\n                # (this also is slower).\n                if record.name not in _IGNORED_LOGGERS:\n                    integration = Hub.current.get_integration(LoggingIntegration)\n                    if integration is not None:\n                        integration._handle_record(record)\n\n        logging.Logger.callHandlers = sentry_patched_callhandlers  # type: ignore\n\n\ndef _can_record(record):\n    # type: (LogRecord) -> bool\n    return record.name not in _IGNORED_LOGGERS\n\n\ndef _breadcrumb_from_record(record):\n    # type: (LogRecord) -> Dict[str, Any]\n    return {\n        \"ty\": \"log\",\n        \"level\": _logging_to_event_level(record.levelname),\n        \"category\": record.name,\n        \"message\": record.message,\n        \"timestamp\": datetime.datetime.fromtimestamp(record.created),\n        \"data\": _extra_from_record(record),\n    }\n\n\ndef _logging_to_event_level(levelname):\n    # type: (str) -> str\n    return {\"critical\": \"fatal\"}.get(levelname.lower(), levelname.lower())\n\n\nCOMMON_RECORD_ATTRS = frozenset(\n    (\n        \"args\",\n        \"created\",\n        \"exc_info\",\n        \"exc_text\",\n        \"filename\",\n        \"funcName\",\n        \"levelname\",\n        \"levelno\",\n        \"linenno\",\n        \"lineno\",\n        \"message\",\n        \"module\",\n        \"msecs\",\n        \"msg\",\n        \"name\",\n        \"pathname\",\n        \"process\",\n        \"processName\",\n        \"relativeCreated\",\n        \"stack\",\n        \"tags\",\n        \"thread\",\n        \"threadName\",\n    )\n)\n\n\ndef _extra_from_record(record):\n    # type: (LogRecord) -> Dict[str, None]\n    return {\n        k: v\n        for k, v in iteritems(vars(record))\n        if k not in COMMON_RECORD_ATTRS\n        and (not isinstance(k, str) or not k.startswith(\"_\"))\n    }\n\n\nclass EventHandler(logging.Handler, object):\n    def emit(self, record):\n        # type: (LogRecord) -> Any\n        with capture_internal_exceptions():\n            self.format(record)\n            return self._emit(record)\n\n    def _emit(self, record):\n        # type: (LogRecord) -> None\n        if not _can_record(record):\n            return\n\n        hub = Hub.current\n        if hub.client is None:\n            return\n\n        client_options = hub.client.options\n\n        # exc_info might be None or (None, None, None)\n        if record.exc_info is not None and record.exc_info[0] is not None:\n            event, hint = event_from_exception(\n                record.exc_info,\n                client_options=client_options,\n                mechanism={\"type\": \"logging\", \"handled\": True},\n            )\n        elif record.exc_info and record.exc_info[0] is None:\n            event = {}\n            hint = {}\n            with capture_internal_exceptions():\n                event[\"threads\"] = {\n                    \"values\": [\n                        {\n                            \"stacktrace\": current_stacktrace(\n                                client_options[\"with_locals\"]\n                            ),\n                            \"crashed\": False,\n                            \"current\": True,\n                        }\n                    ]\n                }\n        else:\n            event = {}\n            hint = {}\n\n        hint[\"log_record\"] = record\n\n        event[\"level\"] = _logging_to_event_level(record.levelname)\n        event[\"logger\"] = record.name\n        event[\"logentry\"] = {\"message\": to_string(record.msg), \"params\": record.args}\n        event[\"extra\"] = _extra_from_record(record)\n\n        hub.capture_event(event, hint=hint)\n\n\n# Legacy name\nSentryHandler = EventHandler\n\n\nclass BreadcrumbHandler(logging.Handler, object):\n    def emit(self, record):\n        # type: (LogRecord) -> Any\n        with capture_internal_exceptions():\n            self.format(record)\n            return self._emit(record)\n\n    def _emit(self, record):\n        # type: (LogRecord) -> None\n        if not _can_record(record):\n            return\n\n        Hub.current.add_breadcrumb(\n            _breadcrumb_from_record(record), hint={\"log_record\": record}\n        )\n", "path": "sentry_sdk/integrations/logging.py"}], "after_files": [{"content": "from __future__ import absolute_import\n\nimport logging\nimport datetime\n\nfrom sentry_sdk.hub import Hub\nfrom sentry_sdk.utils import (\n    to_string,\n    event_from_exception,\n    current_stacktrace,\n    capture_internal_exceptions,\n)\nfrom sentry_sdk.integrations import Integration\nfrom sentry_sdk._compat import iteritems\n\nfrom sentry_sdk._types import MYPY\n\nif MYPY:\n    from logging import LogRecord\n    from typing import Any\n    from typing import Dict\n    from typing import Optional\n\nDEFAULT_LEVEL = logging.INFO\nDEFAULT_EVENT_LEVEL = logging.ERROR\n\n_IGNORED_LOGGERS = set([\"sentry_sdk.errors\"])\n\n\ndef ignore_logger(name):\n    # type: (str) -> None\n    \"\"\"This disables recording (both in breadcrumbs and as events) calls to\n    a logger of a specific name.  Among other uses, many of our integrations\n    use this to prevent their actions being recorded as breadcrumbs. Exposed\n    to users as a way to quiet spammy loggers.\n    \"\"\"\n    _IGNORED_LOGGERS.add(name)\n\n\nclass LoggingIntegration(Integration):\n    identifier = \"logging\"\n\n    def __init__(self, level=DEFAULT_LEVEL, event_level=DEFAULT_EVENT_LEVEL):\n        # type: (Optional[int], Optional[int]) -> None\n        self._handler = None\n        self._breadcrumb_handler = None\n\n        if level is not None:\n            self._breadcrumb_handler = BreadcrumbHandler(level=level)\n\n        if event_level is not None:\n            self._handler = EventHandler(level=event_level)\n\n    def _handle_record(self, record):\n        # type: (LogRecord) -> None\n        if self._handler is not None and record.levelno >= self._handler.level:\n            self._handler.handle(record)\n\n        if (\n            self._breadcrumb_handler is not None\n            and record.levelno >= self._breadcrumb_handler.level\n        ):\n            self._breadcrumb_handler.handle(record)\n\n    @staticmethod\n    def setup_once():\n        # type: () -> None\n        old_callhandlers = logging.Logger.callHandlers  # type: ignore\n\n        def sentry_patched_callhandlers(self, record):\n            # type: (Any, LogRecord) -> Any\n            try:\n                return old_callhandlers(self, record)\n            finally:\n                # This check is done twice, once also here before we even get\n                # the integration.  Otherwise we have a high chance of getting\n                # into a recursion error when the integration is resolved\n                # (this also is slower).\n                if record.name not in _IGNORED_LOGGERS:\n                    integration = Hub.current.get_integration(LoggingIntegration)\n                    if integration is not None:\n                        integration._handle_record(record)\n\n        logging.Logger.callHandlers = sentry_patched_callhandlers  # type: ignore\n\n\ndef _can_record(record):\n    # type: (LogRecord) -> bool\n    return record.name not in _IGNORED_LOGGERS\n\n\ndef _breadcrumb_from_record(record):\n    # type: (LogRecord) -> Dict[str, Any]\n    return {\n        \"ty\": \"log\",\n        \"level\": _logging_to_event_level(record.levelname),\n        \"category\": record.name,\n        \"message\": record.message,\n        \"timestamp\": datetime.datetime.utcfromtimestamp(record.created),\n        \"data\": _extra_from_record(record),\n    }\n\n\ndef _logging_to_event_level(levelname):\n    # type: (str) -> str\n    return {\"critical\": \"fatal\"}.get(levelname.lower(), levelname.lower())\n\n\nCOMMON_RECORD_ATTRS = frozenset(\n    (\n        \"args\",\n        \"created\",\n        \"exc_info\",\n        \"exc_text\",\n        \"filename\",\n        \"funcName\",\n        \"levelname\",\n        \"levelno\",\n        \"linenno\",\n        \"lineno\",\n        \"message\",\n        \"module\",\n        \"msecs\",\n        \"msg\",\n        \"name\",\n        \"pathname\",\n        \"process\",\n        \"processName\",\n        \"relativeCreated\",\n        \"stack\",\n        \"tags\",\n        \"thread\",\n        \"threadName\",\n    )\n)\n\n\ndef _extra_from_record(record):\n    # type: (LogRecord) -> Dict[str, None]\n    return {\n        k: v\n        for k, v in iteritems(vars(record))\n        if k not in COMMON_RECORD_ATTRS\n        and (not isinstance(k, str) or not k.startswith(\"_\"))\n    }\n\n\nclass EventHandler(logging.Handler, object):\n    def emit(self, record):\n        # type: (LogRecord) -> Any\n        with capture_internal_exceptions():\n            self.format(record)\n            return self._emit(record)\n\n    def _emit(self, record):\n        # type: (LogRecord) -> None\n        if not _can_record(record):\n            return\n\n        hub = Hub.current\n        if hub.client is None:\n            return\n\n        client_options = hub.client.options\n\n        # exc_info might be None or (None, None, None)\n        if record.exc_info is not None and record.exc_info[0] is not None:\n            event, hint = event_from_exception(\n                record.exc_info,\n                client_options=client_options,\n                mechanism={\"type\": \"logging\", \"handled\": True},\n            )\n        elif record.exc_info and record.exc_info[0] is None:\n            event = {}\n            hint = {}\n            with capture_internal_exceptions():\n                event[\"threads\"] = {\n                    \"values\": [\n                        {\n                            \"stacktrace\": current_stacktrace(\n                                client_options[\"with_locals\"]\n                            ),\n                            \"crashed\": False,\n                            \"current\": True,\n                        }\n                    ]\n                }\n        else:\n            event = {}\n            hint = {}\n\n        hint[\"log_record\"] = record\n\n        event[\"level\"] = _logging_to_event_level(record.levelname)\n        event[\"logger\"] = record.name\n        event[\"logentry\"] = {\"message\": to_string(record.msg), \"params\": record.args}\n        event[\"extra\"] = _extra_from_record(record)\n\n        hub.capture_event(event, hint=hint)\n\n\n# Legacy name\nSentryHandler = EventHandler\n\n\nclass BreadcrumbHandler(logging.Handler, object):\n    def emit(self, record):\n        # type: (LogRecord) -> Any\n        with capture_internal_exceptions():\n            self.format(record)\n            return self._emit(record)\n\n    def _emit(self, record):\n        # type: (LogRecord) -> None\n        if not _can_record(record):\n            return\n\n        Hub.current.add_breadcrumb(\n            _breadcrumb_from_record(record), hint={\"log_record\": record}\n        )\n", "path": "sentry_sdk/integrations/logging.py"}]}