From b1d94d822b262da890fca91ad9f5991867ec0e19 Mon Sep 17 00:00:00 2001 From: Edoardo Putti Date: Sat, 10 Sep 2016 13:37:56 +0200 Subject: [PATCH] change log to file only --- request_server.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/request_server.py b/request_server.py index 237d1b3..756edf9 100755 --- a/request_server.py +++ b/request_server.py @@ -7,18 +7,14 @@ import sys import time import uuid -logging.basicConfig(level= logging.INFO) - -logger = logging.getLogger(__name__) - -formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') - - -handler = logging.FileHandler('/home/request/request_server.log') - -handler.setFormatter(formatter) - -logger.addHandler(handler) +logfile= '/home/request/request_server.log' +logging.basicConfig( + filename= logfile, + format= '%(asctime)s - %(name)s - %(levelname)s - %(message)s', + level= logging.INFO, + ) + +logger = logging.getLogger('request_server')) REQUESTS_PATH = "/var/lib/ca_manager/requests"