def reopen_log_files(handlers):
 for handler in handlers:
  if (not isinstance(handler, logging.FileHandler)):
   continue
  LOG.info(('Re-opening log file "%s" with mode "%s"\n' % (handler.baseFilename, handler.mode)))
  try:
   handler.acquire()
   handler.stream.close()
   handler.stream = open(handler.baseFilename, handler.mode)
  finally:
   try:
    handler.release()
   except RuntimeError as e:
    if ('cannot release' in str(e)):
     LOG.warn('Failed to release lock', exc_info=True)
    else:
     raise e

def reopen_log_files ( handlers ) : for handler in handlers : if ( not isinstance ( handler , logging . FileHandler ) ) : continue LOG . info ( ( 'Re-opening log file "%s" with mode "%s"\n' % ( handler . baseFilename , handler . mode ) ) ) try : handler . acquire ( ) handler . stream . close ( ) handler . stream = open ( handler . baseFilename , handler . mode ) finally : try : handler . release ( ) except RuntimeError as e : if ( 'cannot release' in str ( e ) ) : LOG . warn ( 'Failed to release lock' , exc_info = True ) else : raise e
this method iterates through all of the providers handlers looking for the filehandler types .