Skip to content

Commit

Permalink
Increased timed log rotation interval, turned compression on by default
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Khoroshavin <[email protected]>
  • Loading branch information
Sergey Khoroshavin committed Apr 4, 2018
1 parent d1fdb5b commit 9330b71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions plenum/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@


# Log configuration
logRotationWhen = 'D'
logRotationWhen = 'W'
logRotationInterval = 1
logRotationBackupCount = 10
logRotationBackupCount = 50
logRotationMaxBytes = 100 * 1024 * 1024
logRotationCompress = False
logRotationCompress = True
logFormat = '{asctime:s} | {levelname:8s} | {filename:20s} ({lineno: >4}) | {funcName:s} | {message:s}'
logFormatStyle = '{'
logLevel = logging.NOTSET
Expand Down
5 changes: 3 additions & 2 deletions stp_core/common/logging/TimeAndSizeRotatingFileHandler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os, gzip
import os
import gzip
from logging.handlers import TimedRotatingFileHandler
from logging.handlers import RotatingFileHandler

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

def shouldRollover(self, record):
return bool(TimedRotatingFileHandler.shouldRollover(self, record)) or \
bool(RotatingFileHandler.shouldRollover(self, record))
bool(RotatingFileHandler.shouldRollover(self, record))

def rotate(self, source, dest):
source_gz = source.endswith(".gz")
Expand Down
6 changes: 3 additions & 3 deletions stp_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
baseDir = os.getcwd()

# Log configuration
logRotationWhen = 'D'
logRotationWhen = 'W'
logRotationInterval = 1
logRotationBackupCount = 10
logRotationBackupCount = 50
logRotationMaxBytes = 100 * 1024 * 1024
logRotationCompress = False
logRotationCompress = True
logFormat = '{asctime:s} | {levelname:8s} | {filename:20s} ({lineno:d}) | {funcName:s} | {message:s}'
logFormatStyle = '{'

Expand Down

0 comments on commit 9330b71

Please sign in to comment.