summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2016-12-31 11:06:57 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2016-12-31 11:06:57 (GMT)
commit53a21eb479a795e4f2902d715b724e89ccf641e6 (patch)
tree5c5f83eb370e29f75e1091fbb083c93d5fd87c55 /Doc/library
parenta50006c9773e80542a8d7a4cf3dad332e16c30fc (diff)
downloadcpython-53a21eb479a795e4f2902d715b724e89ccf641e6.zip
cpython-53a21eb479a795e4f2902d715b724e89ccf641e6.tar.gz
cpython-53a21eb479a795e4f2902d715b724e89ccf641e6.tar.bz2
Closes #29105: Updated RotatingFileHandler documentation.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/logging.handlers.rst15
1 files changed, 8 insertions, 7 deletions
diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst
index 6be3279..5fc32d1 100644
--- a/Doc/library/logging.handlers.rst
+++ b/Doc/library/logging.handlers.rst
@@ -282,16 +282,17 @@ module, supports rotation of disk log files.
You can use the *maxBytes* and *backupCount* values to allow the file to
:dfn:`rollover` at a predetermined size. When the size is about to be exceeded,
the file is closed and a new file is silently opened for output. Rollover occurs
- whenever the current log file is nearly *maxBytes* in length; if either of
- *maxBytes* or *backupCount* is zero, rollover never occurs. If *backupCount*
- is non-zero, the system will save old log files by appending the extensions
- '.1', '.2' etc., to the filename. For example, with a *backupCount* of 5 and
- a base file name of :file:`app.log`, you would get :file:`app.log`,
+ whenever the current log file is nearly *maxBytes* in length; but if either of
+ *maxBytes* or *backupCount* is zero, rollover never occurs, so you generally want
+ to set *backupCount* to at least 1, and have a non-zero *maxBytes*.
+ When *backupCount* is non-zero, the system will save old log files by appending
+ the extensions '.1', '.2' etc., to the filename. For example, with a *backupCount*
+ of 5 and a base file name of :file:`app.log`, you would get :file:`app.log`,
:file:`app.log.1`, :file:`app.log.2`, up to :file:`app.log.5`. The file being
written to is always :file:`app.log`. When this file is filled, it is closed
and renamed to :file:`app.log.1`, and if files :file:`app.log.1`,
- :file:`app.log.2`, etc. exist, then they are renamed to :file:`app.log.2`,
- :file:`app.log.3` etc. respectively.
+ :file:`app.log.2`, etc. exist, then they are renamed to :file:`app.log.2`,
+ :file:`app.log.3` etc. respectively.
.. versionchanged:: 3.6
As well as string values, :class:`~pathlib.Path` objects are also accepted