Skip to content

Commit 8e9c42e

Browse files
committed
Merged documentation update from 3.6.
2 parents 089a062 + 53a21eb commit 8e9c42e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Doc/library/logging.handlers.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,17 @@ module, supports rotation of disk log files.
282282
You can use the *maxBytes* and *backupCount* values to allow the file to
283283
:dfn:`rollover` at a predetermined size. When the size is about to be exceeded,
284284
the file is closed and a new file is silently opened for output. Rollover occurs
285-
whenever the current log file is nearly *maxBytes* in length; if either of
286-
*maxBytes* or *backupCount* is zero, rollover never occurs. If *backupCount*
287-
is non-zero, the system will save old log files by appending the extensions
288-
'.1', '.2' etc., to the filename. For example, with a *backupCount* of 5 and
289-
a base file name of :file:`app.log`, you would get :file:`app.log`,
285+
whenever the current log file is nearly *maxBytes* in length; but if either of
286+
*maxBytes* or *backupCount* is zero, rollover never occurs, so you generally want
287+
to set *backupCount* to at least 1, and have a non-zero *maxBytes*.
288+
When *backupCount* is non-zero, the system will save old log files by appending
289+
the extensions '.1', '.2' etc., to the filename. For example, with a *backupCount*
290+
of 5 and a base file name of :file:`app.log`, you would get :file:`app.log`,
290291
:file:`app.log.1`, :file:`app.log.2`, up to :file:`app.log.5`. The file being
291292
written to is always :file:`app.log`. When this file is filled, it is closed
292293
and renamed to :file:`app.log.1`, and if files :file:`app.log.1`,
293-
:file:`app.log.2`, etc. exist, then they are renamed to :file:`app.log.2`,
294-
:file:`app.log.3` etc. respectively.
294+
:file:`app.log.2`, etc. exist, then they are renamed to :file:`app.log.2`,
295+
:file:`app.log.3` etc. respectively.
295296

296297
.. versionchanged:: 3.6
297298
As well as string values, :class:`~pathlib.Path` objects are also accepted

0 commit comments

Comments
 (0)