add postfix to logfile
This commit is contained in:
parent
f8809da5b1
commit
8fc187a622
|
@ -3,11 +3,12 @@ import urllib2
|
|||
import logging
|
||||
import MySQLdb
|
||||
import time
|
||||
import sys
|
||||
|
||||
r = redis.Redis(host="192.168.80.55",port=6379,db=0)
|
||||
|
||||
logger = logging.getLogger()
|
||||
hdlr = logging.FileHandler("consumer.log")
|
||||
hdlr = logging.FileHandler("consumer-%s.log"%sys.argv[1])
|
||||
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
|
||||
hdlr.setFormatter(formatter)
|
||||
logger.addHandler(hdlr)
|
||||
|
|
Loading…
Reference in New Issue