@@ -227,6 +227,111 @@ beaker.session.auto = False
#beaker.session.cookie_expires = 3600
############################
## ERROR HANDLING SYSTEMS ##
####################
### [errormator] ###
# Errormator is tailored to work with RhodeCode, see
# http://errormator.com for details how to obtain an account
# you must install python package `errormator_client` to make it work
# errormator enabled
errormator = true
errormator.server_url = https://api.errormator.com
errormator.api_key = YOUR_API_KEY
# TWEAK AMOUNT OF INFO SENT HERE
# enables 404 error logging (default False)
errormator.report_404 = false
# time in seconds after request is considered being slow (default 1)
errormator.slow_request_time = 1
# record slow requests in application
# (needs to be enabled for slow datastore recording and time tracking)
errormator.slow_requests = true
# enable hooking to application loggers
# errormator.logging = true
# minimum log level for log capture
# errormator.logging.level = WARNING
# send logs only from erroneous/slow requests
# (saves API quota for intensive logging)
errormator.logging_on_error = false
# list of additonal keywords that should be grabbed from environ object
# can be string with comma separated list of words in lowercase
# (by default client will always send following info:
# 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
# start with HTTP* this list be extended with additional keywords here
errormator.environ_keys_whitelist =
# list of keywords that should be blanked from request object
# (by default client will always blank keys that contain following words
# 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
# this list be extended with additional keywords set here
errormator.request_keys_blacklist =
# list of namespaces that should be ignores when gathering log entries
# can be string with comma separated list of namespaces
# (by default the client ignores own entries: errormator_client.client)
errormator.log_namespace_blacklist =
#
# YOU SHOULD NOT NEED TO TWEAK THIS
# leave server_name empty for auto discovery
# errormator.server_name =
# connection timeout when communicating with API
# errormator.timeout = 10
# reraise exceptions when wsgi catches exception
# errormator.reraise_exceptions = true
# enables 500 error logging
errormator.report_errors = true
# how often send data to mothership Errormator (default 5s)
errormator.buffer_flush_interval = 5
# send all data after request is finished - handy for crons or other voliatile applications
errormator.force_send = false
# custom filter callable to override sensitive data filtering
# errormator.filter_callable = foo.bar.baz:callable_name
################
### [sentry] ###
# sentry is a alternative open source error aggregator
# you must install python packages `sentry` and `raven` to enable
sentry.dsn = YOUR_DNS
sentry.servers =
sentry.name =
sentry.key =
sentry.public_key =
sentry.secret_key =
sentry.project =
sentry.site =
sentry.include_paths =
sentry.exclude_paths =
################################################################################
## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
@@ -53,6 +53,13 @@ def make_app(global_conf, full_stack=Tru
if asbool(full_stack):
from rhodecode.lib.middleware.sentry import Sentry
from rhodecode.lib.middleware.errormator import Errormator
if Errormator:
app = Errormator(app, config)
elif Sentry:
app = Sentry(app, config)
# Handle Python exceptions
app = ErrorHandler(app, global_conf, **config['pylons.errorware'])
new file 100644
# -*- coding: utf-8 -*-
"""
rhodecode.lib.middleware.errormator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
middleware to handle errormator publishing of errors
:created_on: October 18, 2012
:author: marcink
:copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
:license: GPLv3, see COPYING for more details.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
try:
from errormator_client import make_errormator_middleware
except ImportError:
Errormator = None
else:
Errormator = make_errormator_middleware
\ No newline at end of file
rhodecode.lib.middleware.sentry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
middleware to handle sentry/raven publishing of errors
:created_on: September 18, 2012
from raven.base import Client
from raven.contrib.pylons import list_from_setting
from raven.middleware import Sentry as Middleware
Sentry = None
class Sentry(Middleware):
def __init__(self, app, config, client_cls=Client):
client = client_cls(
dsn=config.get('sentry.dsn'),
servers=list_from_setting(config, 'sentry.servers'),
name=config.get('sentry.name'),
key=config.get('sentry.key'),
public_key=config.get('sentry.public_key'),
secret_key=config.get('sentry.secret_key'),
project=config.get('sentry.project'),
site=config.get('sentry.site'),
include_paths=list_from_setting(config, 'sentry.include_paths'),
exclude_paths=list_from_setting(config, 'sentry.exclude_paths'),
)
super(Sentry, self).__init__(app, client)
Status change: