Browse Source

Docs update and change version to 1.6.0

David Cramer 14 years ago
parent
commit
4f11500812
4 changed files with 70 additions and 6 deletions
  1. 11 0
      CHANGES
  2. 53 0
      docs/config.rst
  3. 5 5
      docs/extensions.rst
  4. 1 1
      setup.py

+ 11 - 0
CHANGES

@@ -0,0 +1,11 @@
+
+1.6.0
+
+* Added message references (uuid's) as message_id in Message
+* Fixed css compatibility issues with TextWidget
+* SearchFilter now allows searching by message reference id
+* Added Sentry404CatchMiddleware
+* Added SentryResponseErrorIdMiddleware
+* The `request` argument can now be passed into any create_from_ method.
+
+(History beyond 1.6.0 is not present)

+ 53 - 0
docs/config.rst

@@ -110,6 +110,59 @@ Now ensure you've added ``haystack`` to the ``INSTALLED_APPS`` on Sentry's serve
 
 Enjoy!
 
+404 Logging
+-----------
+
+.. versionadded:: 1.6.0
+
+In certain conditions you may wish to log 404 events to the Sentry server. To do this, you simply need to enable a Django middleware::
+
+	MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
+	  ...,
+	  'sentry.client.middleware.Sentry404CatchMiddleware',
+	)
+
+Message References
+------------------
+
+.. versionadded:: 1.6.0
+
+Sentry supports sending a message ID to your clients so that they can be tracked easily by your development team. There are two ways to access this information, the first is via the ``X-Sentry-ID`` HTTP response header. Adding this is as simple as appending a middleware to your stack::
+
+	MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
+	  # We recommend putting this as high in the chain as possible
+	  'sentry.client.middleware.SentryResponseErrorIdMiddleware',
+	  ...,
+	)
+
+Another alternative method is rendering it within a template. By default, Sentry will attach request.sentry when it catches a Django exception. In our example, we will use this information to modify the default 500.html which is rendered, and show the user a case reference ID. The first step in doing this is creating a custom ``handler500`` in your ``urls.py`` file::
+
+	from django.conf.urls.defaults import *
+	
+	from django.views.defaults import page_not_found, server_error
+	
+	def handler500(request):
+	    """
+	    500 error handler which includes ``request`` in the context.
+	
+	    Templates: `500.html`
+	    Context: None
+	    """
+	    from django.template import Context, loader
+	    from django.http import HttpResponseServerError
+	
+	    t = loader.get_template('500.html') # You need to create a 500.html template.
+	    return HttpResponseServerError(t.render(Context({
+	        'request': request,
+	    })))
+
+Once we've successfully added the request context variable, adding the Sentry reference ID to our 500.html is simple::
+
+	<p>You've encountered an error, oh noes!</p>
+	{% if request.sentry.id %}
+	    <p>If you need assistance, you may reference this error as <strong>{{ request.sentry.id }}</strong>.</p>
+	{% endif %}
+
 Other Settings
 --------------
 

+ 5 - 5
docs/extensions.rst

@@ -80,19 +80,19 @@ If you wish to access these within your own views and models, you may do so via
 
 You can also record errors outside of handler if you want::
 
-	from sentry.client.base import SentryClient
+	from sentry.client.models import client
 	
 	try:
-		...
+	    ...
 	except Exception, exc:
-		SentryClient().create_from_exception([exc_info=None, url=None, view=None])
+	    message_id = client.create_from_exception([exc_info=None, url=None, view=None])
 
 If you wish to log normal messages (useful for non-``logging`` integration)::
 
-	from sentry.client.base import SentryClient
+	from sentry.client.models import client
 	import logging
 	
-	SentryClient().create_from_text('Message Message'[, level=logging.WARNING, url=None])
+	message_id = client.create_from_text('Message Message'[, level=logging.WARNING, url=None])
 
 Both the ``url`` and ``level`` parameters are optional. ``level`` should be one of the following:
 

+ 1 - 1
setup.py

@@ -19,7 +19,7 @@ class mytest(test):
 
 setup(
     name='django-sentry',
-    version='1.6.1',
+    version='1.6.0',
     author='David Cramer',
     author_email='dcramer@gmail.com',
     url='http://github.com/dcramer/django-sentry',