question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why is tornado.application logger ignored?

See original GitHub issue

It appears Sentry do not report any logs from tornado.application logger

https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/tornado.py#L53 ignore_logger(“tornado.application”)

However, it seems the default logger used by Tornado to report unhandled exceptions:

https://github.com/tornadoweb/tornado/blob/682ff8dec2d095b339b62d875252be932ae4a5f2/tornado/web.py#L1762

def log_exception(
    self,
    typ: "Optional[Type[BaseException]]",
    value: Optional[BaseException],
    tb: Optional[TracebackType],
) -> None:
    """Override to customize logging of uncaught exceptions.
    By default logs instances of `HTTPError` as warnings without
    stack traces (on the ``tornado.general`` logger), and all
    other exceptions as errors with stack traces (on the
    ``tornado.application`` logger).
    .. versionadded:: 3.1
    """
    if isinstance(value, HTTPError):
        if value.log_message:
            format = "%d %s: " + value.log_message
            args = [value.status_code, self._request_summary()] + list(value.args)
            gen_log.warning(format, *args)
    else:
        app_log.error(  # type: ignore
            "Uncaught exception %s\n%r",
            self._request_summary(),
            self.request,
            exc_info=(typ, value, tb),
        )

How are we supposed to propagate uncaught exceptions in a Tornado based application to Sentry with Tornado integration?

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
blacellecommented, Nov 15, 2019

Sorry for not having been clear about this: yes, we do not receive any report in Sentry. I asked our python developper to check locally why the monkeypatch did not work.

0reactions
untitakercommented, Nov 17, 2019

we re-enabled the logger for now

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Tornado - No handlers could be found for logger ...
What is the issue? I've already Googled No handlers could be found for logger "tornado.application". and surprisingly all urls suggest same ...
Read more >
Source code for tornado.log
Tornado uses three logger streams: * ``tornado.access``: Per-request logging for ... basestring_type try: import colorama # type: ignore except ImportError: ...
Read more >
tornado logging - Google Groups
Start the script and observe that a file named "log" is created, open it and see that "Starting up" was written to it....
Read more >
web.mit.edu/kolya/.f/root/net.mit.edu/athena.mit.e...
Tornado uses three logger streams: * ``tornado.access``: Per-request ... import curses # type: ignore except ImportError: curses = None # Logger objects for ......
Read more >
bokeh.server.tornado — Bokeh 3.0.2 Documentation
... Provides the Bokeh Server Tornado application. ... None: log.trace("Running session cleanup job") # type: ignore[attr-defined] for app in self.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found