diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/logging.txt | 11 | ||||
| -rw-r--r-- | docs/releases/5.1.txt | 5 | ||||
| -rw-r--r-- | docs/topics/http/sessions.txt | 14 |
3 files changed, 26 insertions, 4 deletions
diff --git a/docs/ref/logging.txt b/docs/ref/logging.txt index 6d8861299f..8a7e58997e 100644 --- a/docs/ref/logging.txt +++ b/docs/ref/logging.txt @@ -286,6 +286,17 @@ Messages to this logger have ``params`` and ``sql`` in their extra context (but unlike ``django.db.backends``, not duration). The values have the same meaning as explained in :ref:`django-db-logger`. +.. _django-contrib-sessions-logger: + +``django.contrib.sessions`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Log messages related to the :doc:`session framework</topics/http/sessions>`. + +* Non-fatal errors occurring when using the + :class:`django.contrib.sessions.backends.cached_db.SessionStore` engine are + logged as ``ERROR`` messages with the corresponding traceback. + Handlers -------- diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt index 3fe0e65410..a4a7f359c6 100644 --- a/docs/releases/5.1.txt +++ b/docs/releases/5.1.txt @@ -115,7 +115,10 @@ Minor features :mod:`django.contrib.sessions` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* ... +* :class:`django.contrib.sessions.backends.cached_db.SessionStore` now handles + exceptions when storing session information in the cache, logging proper + error messages with their traceback via the newly added + :ref:`sessions logger <django-contrib-sessions-logger>`. :mod:`django.contrib.sitemaps` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/topics/http/sessions.txt b/docs/topics/http/sessions.txt index 4f635f1704..d799c245de 100644 --- a/docs/topics/http/sessions.txt +++ b/docs/topics/http/sessions.txt @@ -76,9 +76,17 @@ Once your cache is configured, you have to choose between a database-backed cache or a non-persistent cache. The cached database backend (``cached_db``) uses a write-through cache -- -session writes are applied to both the cache and the database. Session reads -use the cache, or the database if the data has been evicted from the cache. To -use this backend, set :setting:`SESSION_ENGINE` to +session writes are applied to both the database and cache, in that order. If +writing to the cache fails, the exception is handled and logged via the +:ref:`sessions logger <django-contrib-sessions-logger>`, to avoid failing an +otherwise successful write operation. + +.. versionchanged:: 5.1 + + Handling and logging of exceptions when writing to the cache was added. + +Session reads use the cache, or the database if the data has been evicted from +the cache. To use this backend, set :setting:`SESSION_ENGINE` to ``"django.contrib.sessions.backends.cached_db"``, and follow the configuration instructions for the `using database-backed sessions`_. |
