summaryrefslogtreecommitdiffstats
path: root/ocrloader.py
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2015-05-05 08:51:10 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2015-05-05 08:51:10 (GMT)
commit44d84f11cee921e5acb36546d1a6a4f8783fe826 (patch)
tree72cb20dc5a8de9949bb65b7df359561200b59afe /ocrloader.py
parent27109e6a075e9658033928e11392af3d7292b775 (diff)
downloadpfwbged.ocrloader-44d84f11cee921e5acb36546d1a6a4f8783fe826.zip
pfwbged.ocrloader-44d84f11cee921e5acb36546d1a6a4f8783fe826.tar.gz
pfwbged.ocrloader-44d84f11cee921e5acb36546d1a6a4f8783fe826.tar.bz2
rotate log files
Diffstat (limited to 'ocrloader.py')
-rwxr-xr-xocrloader.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ocrloader.py b/ocrloader.py
index 4ab1be7..debdf4d 100755
--- a/ocrloader.py
+++ b/ocrloader.py
@@ -27,10 +27,14 @@ config_filepath = options.config
import logging
+logging.getLogger().addHandler(logging.StreamHandler())
logging.basicConfig(level=logging.DEBUG,
- filename='/var/log/pfwbged.ocrloader.log',
format='%(asctime)s %(message)s')
logging.getLogger().addHandler(logging.StreamHandler())
+logging.getLogger().addHandler(logging.handlers.RotatingFileHandler(
+ filename='/var/log/pfwbged.ocrloader.log',
+ maxBytes=1000*1000
+ ))
def process(cfg, filename, payload, enable_ocr=True):
ocr_filename = os.path.join(cfg.get('ocrized_directory'), filename)