Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
69f0249d
Kaydet (Commit)
69f0249d
authored
Ara 31, 2013
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #19395 -- Added a simple example logging config.
Thanks ken.nelson at maclaren.com.
üst
f46603f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
4 deletions
+33
-4
logging.txt
docs/topics/logging.txt
+33
-4
No files found.
docs/topics/logging.txt
Dosyayı görüntüle @
69f0249d
...
@@ -230,13 +230,40 @@ use in your project code.
...
@@ -230,13 +230,40 @@ use in your project code.
.. _dictConfig format: http://docs.python.org/library/logging.config.html#configuration-dictionary-schema
.. _dictConfig format: http://docs.python.org/library/logging.config.html#configuration-dictionary-schema
An example
Examples
--------
--
--------
The full documentation for `dictConfig format`_ is the best source of
The full documentation for `dictConfig format`_ is the best source of
information about logging configuration dictionaries. However, to give
information about logging configuration dictionaries. However, to give
you a taste of what is possible, here is an example of a fairly
you a taste of what is possible, here are a couple examples.
complex logging setup, configured using :func:`logging.config.dictConfig`::
First, here's a simple configuration which writes all request logging from the
:ref:`django-request-logger` logger to a local file::
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/path/to/django/debug.log',
},
},
'loggers': {
'django.request': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}
If you use this example, be sure to change the ``'filename'`` path to a
location that's writable by the user that's running the Django application.
Second, here's an example of a fairly complex logging setup, configured using
:func:`logging.config.dictConfig`::
LOGGING = {
LOGGING = {
'version': 1,
'version': 1,
...
@@ -396,6 +423,8 @@ Django provides four built-in loggers.
...
@@ -396,6 +423,8 @@ Django provides four built-in loggers.
``django`` is the catch-all logger. No messages are posted directly to
``django`` is the catch-all logger. No messages are posted directly to
this logger.
this logger.
.. _django-request-logger:
``django.request``
``django.request``
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment