From daf8361ac702b21a54fc867df78abb0910f18bbc Mon Sep 17 00:00:00 2001 From: Bryan Chow Date: Tue, 7 Sep 2010 22:22:36 -0700 Subject: [PATCH 1/2] Remove duplicate testBadData from RemoteSentryTest --- sentry/tests/tests.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sentry/tests/tests.py b/sentry/tests/tests.py index e422925b16ab2c..2f0a43a5226dc6 100644 --- a/sentry/tests/tests.py +++ b/sentry/tests/tests.py @@ -567,14 +567,6 @@ def testBadData(self): self.assertEquals(resp.status_code, 403) self.assertEquals(resp.content, 'Bad data') - def testBadData(self): - resp = self.client.post(reverse('sentry-store'), { - 'key': settings.KEY, - 'data': 'hello world', - }) - self.assertEquals(resp.status_code, 403) - self.assertEquals(resp.content, 'Bad data') - def testCorrectData(self): kwargs = {'message': 'hello', 'server_name': 'not_dcramer.local', 'level': 40} data = { From 2fea25bf0556c47b2debdd33bec095912bac90f7 Mon Sep 17 00:00:00 2001 From: Bryan Chow Date: Tue, 7 Sep 2010 22:42:01 -0700 Subject: [PATCH 2/2] Make multi-server configuration clearer in README --- README.rst | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/README.rst b/README.rst index b0e404e160d09b..5b8d4747431714 100644 --- a/README.rst +++ b/README.rst @@ -66,29 +66,11 @@ Finally, run ``python manage.py syncdb`` to create the database tables. (If you use South, you'll need to use ``python manage.py migrate sentry``) -============= -Configuration -============= +========================== +Multi-server configuration +========================== -Several options exist to configure django-sentry via your ``settings.py``: - -####################### -SENTRY_CATCH_404_ERRORS -####################### - -Enable catching of 404 errors in the logs. Default value is ``False``:: - - SENTRY_CATCH_404_ERRORS = True - -You can skip other custom exception types by adding a ``skip_sentry = True`` attribute to them. - -################# -SENTRY_REMOTE_URL -################# - -If you run on a multi server environment we highly recommend this method for storing error logs. - -This is a two step process. First you'll want to configure your Sentry server (not your application):: +To configure Sentry for use in a multi-server environment, first you'll want to configure your Sentry server (not your application):: INSTALLED_APPS = [ ... @@ -97,21 +79,41 @@ This is a two step process. First you'll want to configure your Sentry server (n 'sentry', 'sentry.client', ] + + SENTRY_KEY = '0123456789abcde' -And on your main application, you need to add ``sentry.client``:: +And on each of your application servers, specify the URL of the Sentry server, add ``sentry.client`` to ``INSTALLED_APPS``, and specify the same key used in your Sentry server's settings:: # This should be the absolute URI of sentries store view - SENTRY_REMOTE_URL = 'SENTRY_URL_BASE/store/' + SENTRY_REMOTE_URL = 'http://your.sentry.server/sentry/store/' INSTALLED_APPS = [ ... 'sentry.client', ] + + SENTRY_KEY = '0123456789abcde' You may also specify an alternative timeout to the default (which is 5 seconds) for all outgoing logging requests:: SENTRY_REMOTE_TIMEOUT = 5 +=========================== +Other configuration options +=========================== + +Several options exist to configure django-sentry via your ``settings.py``: + +####################### +SENTRY_CATCH_404_ERRORS +####################### + +Enable catching of 404 errors in the logs. Default value is ``False``:: + + SENTRY_CATCH_404_ERRORS = True + +You can skip other custom exception types by adding a ``skip_sentry = True`` attribute to them. + ##################### SENTRY_DATABASE_USING #####################