Skip to content

Commit 7e13e9a

Browse files
author
Sebastian Wagner
committed
Merge branch 'wagner/fix-1778' into maintenance
2 parents 4e60abe + e39a3f7 commit 7e13e9a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ CHANGELOG
77
### Configuration
88

99
### Core
10+
- `intelmq.lib.utils`:
11+
- `log`: Handle null value for logging parameter `logging_max_size` (PR#1786 by Sebastian Wagner, fixes #1778).
1012

1113
### Development
1214

intelmq/lib/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,10 @@ def log(name: str, log_path: Union[str, bool] = intelmq.DEFAULT_LOGGING_PATH,
330330
logging_level_stream:
331331
The logging level for stream (console) output.
332332
By default the same as log_level.
333+
log_max_size:
334+
The maximum size of the logfile. 0 means no restriction.
335+
log_max_copies:
336+
Maximum number of logfiles to keep.
333337
334338
Returns:
335339
logger: An instance of logging.Logger
@@ -352,7 +356,7 @@ def log(name: str, log_path: Union[str, bool] = intelmq.DEFAULT_LOGGING_PATH,
352356

353357
if log_path and not syslog:
354358
handler = RotatingFileHandler("%s/%s.log" % (log_path, name),
355-
maxBytes=log_max_size,
359+
maxBytes=log_max_size if log_max_size else 0,
356360
backupCount=log_max_copies)
357361
handler.setLevel(log_level)
358362
handler.setFormatter(logging.Formatter(LOG_FORMAT))

0 commit comments

Comments
 (0)