logging - How to modify the twisted log format? -


i use twisted's dailylogfile,and run this:

twistd --logfile=test.log myserver_tapname 

the log file this:

test.log.2014_3_9 

but hope log this:

test.log.2014_03_09 

how can format output filename? thanks!

given file named my.py code:

from twisted.python.log import filelogobserver import time extension = time.strftime("%y_%m_%d") def logger():     return filelogobserver(open("/tmp/test.log."+extension, "w")).emit 

invoking

 twistd --logger my.logger ... 

will log file named /tmp/test.log.2014_03_28.log


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -