Commit graph

503 commits

Author SHA1 Message Date
Miss Islington (bot)
bc237ed9a8
[3.12] gh-124653: Relax (again) detection of queue API for logging handlers (GH-124897) (GH-125060)
(cherry picked from commit 7ffe94fb24)
2024-10-08 07:24:09 +01:00
Miss Islington (bot)
7cb8d28e50
[3.12] gh-116263: Do not rollover empty files in RotatingFileHandler (GH-122788) (#122815)
(cherry picked from commit 6094c6fc2f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-06 15:47:42 +02:00
Miss Islington (bot)
c47943aa5e
[3.12] gh-121723: Relax constraints on queue objects for logging.handlers.QueueHandler. (GH-122154) (GH-122604)
(cherry picked from commit fb864c76cd)
2024-08-02 12:46:04 +01:00
Miss Islington (bot)
b31f7e2e90
[3.12] gh-120868: Fix breaking change in logging.config when using QueueHandler (GH-120872) (GH-121077)
(cherry picked from commit 7d9c68513d)
2024-06-28 17:10:53 +01:00
Miss Islington (bot)
2a68ed986e
[3.12] gh-105623 Fix performance degradation in logging RotatingFileHandler (GH-105887) (GH-121116)
The check for whether the log file is a real file is expensive on NFS
filesystems.  This commit reorders the rollover condition checking to
not do the file type check if the expected file size is less than the
rotation threshold.

(cherry picked from commit e9b4ec614b)

Co-authored-by: Craig Robson <craig@zhatt.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2024-06-28 09:09:38 +00:00
Miss Islington (bot)
8d199774cb
[3.12] gh-119819: Update logging configuration to support joinable multiproc… (GH-120090) (GH-120092)
(cherry picked from commit 983efcf15b)
2024-06-05 07:59:15 +01:00
Miss Islington (bot)
0e150c36de
[3.12] gh-119819: Fix regression to allow logging configuration with multipr… (GH-120030) (GH-120034)
(cherry picked from commit 99d945c0c0)
2024-06-04 13:41:02 +01:00
Miss Islington (bot)
fe68908c54
[3.12] gh-118868: logging QueueHandler fix passing of kwargs (GH-118869) (GH-120031)
(cherry picked from commit dce14bb2dc)
2024-06-04 13:17:46 +01:00
Miss Islington (bot)
2b68c81283
[3.12] gh-117975: Ensure flush level is checked when configuring a logging MemoryHandler. (GH-117976) (GH-117986)
(cherry picked from commit 6d0bb43232)
2024-04-17 14:48:09 +01:00
Miss Islington (bot)
135a698d5c
[3.12] [docs] Fix typo in docstring and add example to logging cookbook. (GH-117157) (GH-117159)
(cherry picked from commit 00baaa21de)
2024-03-22 17:50:02 +00:00
Miss Islington (bot)
547e8827e6
[3.12] gh-90535: Fix support of interval>1 in logging.TimedRotatingFileHandler (GH-116220) (GH-116892)
Fix support of interval values > 1 in logging.TimedRotatingFileHandler
for when='MIDNIGHT' and when='Wx'.
(cherry picked from commit 269051d20e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-18 19:47:26 +02:00
Miss Islington (bot)
3f830adf58
[3.12] gh-115809: Improve TimedRotatingFileHandler.getFilesToDelete() (GH-115812) (GH-116261)
Improve algorithm for computing which rolled-over log files to delete
in logging.TimedRotatingFileHandler. It is now reliable for handlers
without namer and with arbitrary deterministic namer that leaves
the datetime part in the file name unmodified.
(cherry picked from commit 87faec28c7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-03 07:59:10 +00:00
Miss Islington (bot)
6aadabcfe6
[3.12] gh-114494: Change logging docstring to bool for exec_info (GH=114558) (GH-114624)
(cherry picked from commit 07236f5b39)

Co-authored-by: Tristan Pank <tristanpank@gmail.com>
2024-03-02 14:33:15 +02:00
Miss Islington (bot)
8dae3faab6
[3.12] gh-88352: Fix logging.TimedRotatingFileHandler (GH-116191) (GH-116208)
* Do not overwrite already rolled over files. It happened at midnight or
  during the DST change and caused the loss of data.
* computeRollover() now always return the timestamp larger than the
  specified time.
* Fix computation of the rollover time during the DST change.
(cherry picked from commit fee86fd9a4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-01 18:41:30 +02:00
Miss Islington (bot)
3651c2729a
[3.12] gh-93205: When rotating logs with no namer specified, match whole extension (GH-93224) (GH-115784)
(cherry picked from commit 113687a838)

Co-authored-by: Gabriele Catania <gabriele.ctn@gmail.com>
2024-02-21 21:36:25 +00:00
Serhiy Storchaka
225856ef3e
[3.12] gh-115233: Fix an example in the Logging Cookbook (GH-115325) (GH-115355)
Also add more tests for LoggerAdapter.

Also support stacklevel in LoggerAdapter._log().
(cherry picked from commit 91822018ee)
2024-02-12 18:29:48 +00:00
Miss Islington (bot)
ba3e19a5d7
[3.12] gh-111615: Fix regression in QueueHandler configuration. (GH-111638) (GH-113507) 2023-12-27 14:20:36 +00:00
Miss Islington (bot)
09df271965
[3.12] gh-110875: Handle '.' properties in logging formatter configuration c… (GH-110943) (GH-111911)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2023-11-09 19:34:10 +00:00
Miss Islington (bot)
713210985b
[3.12] gh-111276: Clarify docs and comments about the role of LC_CTYPE (GH-111319) (#111391)
Fix locale.LC_CTYPE documentation to no longer mention string.lower() et al. Those functions were removed in Python 3.0:
https://docs.python.org/2/library/string.htmlGH-deprecated-string-functions

Also, fix a comment in logging about locale-specific behavior of `str.lower()`.

(cherry picked from commit 6d42759c5e)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-27 17:15:06 +02:00
Miss Islington (bot)
dd431d791f
[3.12] gh-107028: tiny textual changes in logging docs and docstrings (GH-107029) (GH-107065)
(cherry picked from commit 5e5a34ac3a)
2023-07-22 22:11:29 +01:00
Prince Roshan
12f1581b0c
gh-103606: raise RuntimeError if config file is invalid or empty (#104701)
(this adjusts new code) raise RuntimeError if provided config file is invalid or empty, not ValueError.
2023-05-20 22:26:49 +00:00
Prince Roshan
152227b569
gh-103606: Improve error message from logging.config.FileConfig (GH-103628) 2023-05-18 05:20:47 +01:00
Bar Harel
8f54302ab4
gh-103357: Add logging.Formatter defaults support to logging.config fileConfig and dictConfig (GH-103359) 2023-04-12 08:35:56 +01:00
Irit Katriel
44bd3fe570
gh-102799: use exception instance instead of sys.exc_info() (#102885) 2023-03-31 11:23:02 +01:00
cemysce
1d1bb95abd
gh-99811: Use correct variable to search for time in format string (GH-99812)
Use correct variable to search for asctime
2022-11-28 18:25:03 +00:00
Vinay Sajip
f6b1e4048d
gh-98307: Add docstring and documentation for SysLogHandler.createSocket (GH-98319)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-10-16 09:15:46 +01:00
Vinay Sajip
ac4ddab405
gh-90195: Unset logger disabled flag when configuring it. (GH-96530) 2022-09-03 13:38:38 +01:00
Vinay Sajip
29f1b0bb1f
gh-89258: Add a getChildren() method to logging.Logger. (GH-96444)
Co-authored-by: Éric <merwok@netwok.org>
2022-08-31 10:50:29 +01:00
Vinay Sajip
6fbd889d6e
gh-89047: Fix msecs computation so you never end up with 1000 msecs. (GH-96340) 2022-08-27 13:33:24 +01:00
Vinay Sajip
013e659e49
gh-92007: Handle elevation errors in NTEventLogHandler more grace… (GH-96322) 2022-08-27 12:13:19 +01:00
Duncan Grisby
1499d73b3e
gh-96159: Fix significant performance degradation in logging.TimedRotat… (GH-96182) 2022-08-23 07:28:43 +01:00
David Bonner
37c0f9ccc0
gh-95804: Respect MemoryHandler.flushOnClose in logging shutdown. (GH-95857) 2022-08-10 18:08:55 +01:00
Robert O'Shea
cd26595232
gh-95454: Replace truthy/falsy with true/false (GH-95456) 2022-07-30 00:42:21 -07:00
Erik Montnemery
c60f125533
bpo-46755: Don't log stack info twice in QueueHandler (GH-31355) 2022-07-05 15:23:12 +01:00
Adrian Garcia Badaracco
296081a7ce
gh-92592: Allow logging filters to return a LogRecord. (GH-92591) 2022-06-07 16:53:57 +01:00
Vinay Sajip
1b74803991
gh-93162: Add ability to configure QueueHandler/QueueListener together (GH-93269)
Also, provide getHandlerByName() and getHandlerNames() APIs.

Closes #93162.
2022-06-07 10:20:35 +02:00
Colin Delahunty
3d647e70cf
[doc] Correct a grammatical error in a docstring. (GH-93441) 2022-06-04 17:42:08 +01:00
jackh-ncl
cc377063ef
gh-91513: Add 'asyncio' taskName to logging LogRecord attributes. (GH-93193) 2022-05-26 09:30:51 +01:00
Thomas Miedema
5e9323a547
Delete outdated comment in logging module (#31117)
The root logger is now accessible via its name, see
https://github.com/python/cpython/pull/15077

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-02 16:29:03 -06:00
Alex Waygood
ab616d323d
gh-92128: Add __class_getitem__ to logging.LoggerAdapter and logging.StreamHandler (#92129)
Closes #92128
2022-05-02 09:10:02 -06:00
Jouke Witteveen
c12ba6b2ff
bpo-45171: Remove tests of deprecated logger.warn(). (GH-32139) 2022-03-27 19:22:05 +01:00
Jouke Witteveen
5ca6d7469b
bpo-45171: Fix stacklevel handling in logging. (GH-28287) 2022-03-27 14:49:28 +01:00
Michael P. Nitowski
d8066b420b
bpo-46557: Log captured warnings without format string (GH-30975) 2022-03-15 09:01:03 +00:00
Mario Corchero
d7c6863979
bpo-41906: Accept built filters in dictConfig (GH-30756)
When configuring the logging stack, accept already built filters (or
just callables) in the filters array of loggers and handlers.
This facilitates passing quick callables as filters.

Automerge-Triggered-By: GH:vsajip
2022-01-24 04:39:50 -08:00
Irit Katriel
0d639678d3
bpo-46332: use raise..from instead of assigning __cause__ and raising (GH-30517) 2022-01-10 18:59:21 +00:00
Vinay Sajip
cb589d1b6b
bpo-46063: Improve algorithm for computing which rolled-over log file… (GH-30093) 2021-12-14 00:53:37 +00:00
Vinay Sajip
8a77f59de5
bpo-45628: Check all parts of the suffix for an extension match. (GH-29310) 2021-10-29 14:40:37 +01:00
Vinay Sajip
62a667784b
bpo-45401: Change shouldRollover() methods to only rollover regular f… (GH-28822)
…iles.

Also changed some historical return values from 1 -> True and 0 -> False.
2021-10-10 08:15:24 -07:00
Kirill Pinchuk
3d315c3116
bpo-44291: Fix reconnection in logging.handlers.SysLogHandler (GH-26490) 2021-08-05 14:58:16 +01:00
Vinay Sajip
6ff8903809
bpo-44753: Don't use logfile extension when determining old files to be deleted (GH-27475) 2021-07-30 12:48:50 +01:00