Browse Source

Update docs

David Cramer 15 years ago
parent
commit
8b0983e9f0
1 changed files with 5 additions and 1 deletions
  1. 5 1
      README.rst

+ 5 - 1
README.rst

@@ -47,8 +47,9 @@ Once installed, update your settings.py and add the middleware and installed app
 	    'django.middleware.common.CommonMiddleware',
 	    'django.contrib.sessions.middleware.SessionMiddleware',
 	    'django.contrib.auth.middleware.AuthenticationMiddleware',
-	    ...
+	    # placement is important
 	    'djangodblog.middleware.DBLogMiddleware',
+	    ...
 	)
 
 	INSTALLED_APPS = (
@@ -120,6 +121,9 @@ django-db-log supports the ability to directly tie into the ``logging`` module.
 	
 	logging.getLogger().addHandler(DBLogHandler())
 
+	# Add StreamHandler to dblog's default so you can catch missed exceptions
+	logging.getLogger('dblog').addHandler(logging.StreamHandler())
+
 You can also use the ``exc_info`` and ``extra=dict(url=foo)`` arguments on your ``log`` methods. This will store the appropriate information and allow django-db-log to render it based on that information:
 
 	logging.error('There was some crazy error', exc_info=sys.exc_info(), extra={'url': request.build_absolute_uri()})