def configure_paramiko_logging():
 l = logging.getLogger('paramiko')
 l.setLevel(logging.DEBUG)
 static.create_sc_config_dirs()
 lh = logging.handlers.RotatingFileHandler(static.SSH_DEBUG_FILE, maxBytes=1048576, backupCount=2)
 lh.setLevel(logging.DEBUG)
 format = (('PID: %s ' % str(static.PID)) + '%(levelname)-.3s [%(asctime)s.%(msecs)03d] thr=%(_threadid)-3d %(name)s: %(message)s')
 date_format = '%Y%m%d-%H:%M:%S'
 lh.setFormatter(logging.Formatter(format, date_format))
 l.addHandler(lh)

def configure_paramiko_logging ( ) : l = logging . getLogger ( 'paramiko' ) l . setLevel ( logging . DEBUG ) static . create_sc_config_dirs ( ) lh = logging . handlers . RotatingFileHandler ( static . SSH_DEBUG_FILE , maxBytes = 1048576 , backupCount = 2 ) lh . setLevel ( logging . DEBUG ) format = ( ( 'PID: %s ' % str ( static . PID ) ) + '%(levelname)-.3s [%(asctime)s.%(msecs)03d] thr=%(_threadid)-3d %(name)s: %(message)s' ) date_format = '%Y%m%d-%H:%M:%S' lh . setFormatter ( logging . Formatter ( format , date_format ) ) l . addHandler ( lh )
configure ssh to log to a file for debug .