This module allows painless Sentry integration with Odoo.
The module can be installed just like any other Odoo module, by adding the
module's directory to Odoo addons_path. In order for the module to correctly
wrap the Odoo WSGI application, it also needs to be loaded as a server-wide
module. This can be done with the server_wide_modules
parameter in your
Odoo config file or with the --load
command-line parameter.
This module additionally requires the raven Python package to be available on the system. It can be installed using pip:
pip install raven
The following additional configuration options can be added to your Odoo configuration file:
Option | Description | Default |
---|---|---|
sentry_dsn |
Sentry Data Source Name. You can find this value in your Sentry project configuration. Typically it looks something like this: https://<public_key>:<secret_key>@sentry.example.com/<project id> This is the only required option in order to use the module. | '' |
sentry_enabled |
Whether or not Sentry logging is enabled. | False |
sentry_logging_level |
The minimal logging level for which to send reports to Sentry. Possible values: notset, debug, info, warn, error, critical. It is recommended to have this set to at least warn, to avoid spamming yourself with Sentry events. | warn |
sentry_exclude_loggers |
A string of comma-separated logger names which should be excluded from Sentry. | werkzeug |
sentry_ignored_exceptions |
A string of comma-separated exceptions which should be ignored. You can use a star symbol (*) at the end, to ignore all exceptions from a module, eg.: odoo.exceptions.*. | odoo.exceptions.AccessDenied,
odoo.exceptions.AccessError,
odoo.exceptions.DeferredException,
odoo.exceptions.MissingError,
odoo.exceptions.RedirectWarning,
odoo.exceptions.UserError,
odoo.exceptions.ValidationError,
odoo.exceptions.Warning,
odoo.exceptions.except_orm |
sentry_processors |
A string of comma-separated processor classes which will be applied on an event before sending it to Sentry. | raven.processors.SanitizePasswordsProcessor,
odoo.addons.sentry.logutils.SanitizeOdooCookiesProcessor |
sentry_transport |
Transport class which will be used to send events to Sentry. Possible values: threaded: spawns an async worker for processing messages, synchronous: a synchronous blocking transport; requests_threaded: an asynchronous transport using the requests library; requests_synchronous - blocking transport using the requests library. | threaded |
sentry_include_context |
If enabled, additional context data will be extracted from current HTTP request and user session (if available). This has no effect for Cron jobs, as no request/session is available inside a Cron job. | True |
sentry_odoo_dir |
Absolute path to your Odoo installation directory. This is optional and will only be used to extract the Odoo Git commit, which will be sent to Sentry, to allow to distinguish between Odoo updates. |
Other client arguments can be
configured by prepending the argument name with sentry_ in your Odoo config
file. Currently supported additional client arguments are: install_sys_hook,
include_paths, exclude_paths, machine, auto_log_stacks, capture_locals,
string_max_length, list_max_length, site, include_versions, environment
.
Below is an example of Odoo configuration file with Odoo Sentry options:
[options] sentry_dsn = https://<public_key>:<secret_key>@sentry.example.com/<project id> sentry_enabled = true sentry_logging_level = warn sentry_exclude_loggers = werkzeug sentry_ignore_exceptions = odoo.exceptions.AccessDenied,odoo.exceptions.AccessError,odoo.exceptions.MissingError,odoo.exceptions.RedirectWarning,odoo.exceptions.UserError,odoo.exceptions.ValidationError,odoo.exceptions.Warning,odoo.exceptions.except_orm sentry_processors = raven.processors.SanitizePasswordsProcessor,odoo.addons.sentry.logutils.SanitizeOdooCookiesProcessor sentry_transport = threaded sentry_include_context = true sentry_environment = production sentry_auto_log_stacks = false sentry_odoo_dir = /home/odoo/odoo/
Once configured and installed, the module will report any logging event at and above the configured Sentry logging level, no additional actions are necessary.
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smash it by providing detailed and welcomed feedback.
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
To contribute to this module, please visit https://odoo-community.org.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。