{ "html": "
If you haven’t already, start by downloading Raven. The easiest way is\nwith pip:
\npip install raven --upgrade\n
A filter factory for PasteDeploy exists to allow easily inserting Raven into a WSGI pipeline:
\n[pipeline:main]\npipeline =\n raven\n tm\n MyApp\n\n[filter:raven]\nuse = egg:raven#raven\ndsn = ___DSN___\ninclude_paths = my.package, my.other.package\nexclude_paths = my.package.crud\n
In the [filter:raven]
section, you must specify the entry-point for raven with the use =
key. All other raven client parameters can be included in this section as well.
See the Pyramid PasteDeploy Configuration Documentation for more information.
\nAdd the following lines to your project’s .ini file to setup SentryHandler:
\n[loggers]\nkeys = root, sentry\n\n[handlers]\nkeys = console, sentry\n\n[formatters]\nkeys = generic\n\n[logger_root]\nlevel = INFO\nhandlers = console, sentry\n\n[logger_sentry]\nlevel = WARN\nhandlers = console\nqualname = sentry.errors\npropagate = 0\n\n[handler_console]\nclass = StreamHandler\nargs = (sys.stderr,)\nlevel = NOTSET\nformatter = generic\n\n[handler_sentry]\nclass = raven.handlers.logging.SentryHandler\nargs = ('___DSN___',)\nlevel = WARNING\nformatter = generic\n\n[formatter_generic]\nformat = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s\ndatefmt = %H:%M:%S\n
Note
\nYou may want to setup other loggers as well. See the Pyramid Logging Documentation for more information.
\nInstead of defining the DSN in the .ini file you can also use the environment variable SENTRY_DSN
which overwrites the setting in this file. Because of a syntax check you cannot remove the args
setting completely, as workaround you can define an empty list of arguments args = ()
.