Skip to content

Commit 087a3eb

Browse files
author
Sergey Khoroshavin
committed
Increased timed log rotation interval, turned compression on by default
Signed-off-by: Sergey Khoroshavin <[email protected]>
1 parent 4cffdc6 commit 087a3eb

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

plenum/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@
149149

150150

151151
# Log configuration
152-
logRotationWhen = 'D'
152+
logRotationWhen = 'W'
153153
logRotationInterval = 1
154-
logRotationBackupCount = 10
154+
logRotationBackupCount = 50
155155
logRotationMaxBytes = 100 * 1024 * 1024
156-
logRotationCompress = False
156+
logRotationCompress = True
157157
logFormat = '{asctime:s} | {levelname:8s} | {filename:20s} ({lineno: >4}) | {funcName:s} | {message:s}'
158158
logFormatStyle = '{'
159159
logLevel = logging.NOTSET

stp_core/common/logging/TimeAndSizeRotatingFileHandler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import os, gzip
1+
import os
2+
import gzip
23
from logging.handlers import TimedRotatingFileHandler
34
from logging.handlers import RotatingFileHandler
45

@@ -17,7 +18,7 @@ def __init__(self, filename, when='h', interval=1, backupCount=0,
1718

1819
def shouldRollover(self, record):
1920
return bool(TimedRotatingFileHandler.shouldRollover(self, record)) or \
20-
bool(RotatingFileHandler.shouldRollover(self, record))
21+
bool(RotatingFileHandler.shouldRollover(self, record))
2122

2223
def rotate(self, source, dest):
2324
source_gz = source.endswith(".gz")

stp_core/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
baseDir = os.getcwd()
88

99
# Log configuration
10-
logRotationWhen = 'D'
10+
logRotationWhen = 'W'
1111
logRotationInterval = 1
12-
logRotationBackupCount = 10
12+
logRotationBackupCount = 50
1313
logRotationMaxBytes = 100 * 1024 * 1024
14-
logRotationCompress = False
14+
logRotationCompress = True
1515
logFormat = '{asctime:s} | {levelname:8s} | {filename:20s} ({lineno:d}) | {funcName:s} | {message:s}'
1616
logFormatStyle = '{'
1717

0 commit comments

Comments
 (0)