logging - python rotating file handler callback -
i'm using rotatingfilehandler (https://docs.python.org/2/library/logging.handlers.html) in python log messages - there anyway function callback when rotatingfilehandler switches new file?
for example, i'm logging messages, , when file rotates want process of messages using defined function
thanks!
there's not callback, can subclass rotatingfilehandler , override own "rotation", implementing dorollover method:
myfilehandler(rotatingfilehandler): def dorollover(): # invoke superclass' actual rotation implementation super(myfilehandler, self).dorollover() # start doing own tasks # ...
Comments
Post a Comment