def set_log_format(log_format, server=_DEFAULT_SERVER):
 setting = 'LogPluginClsid'
 log_format_types = get_log_format_types()
 format_id = log_format_types.get(log_format, None)
 if (not format_id):
  message = "Invalid log format '{0}' specified. Valid formats: {1}".format(log_format, log_format_types.keys())
  raise SaltInvocationError(message)
 _LOG.debug("Id for '%s' found: %s", log_format, format_id)
 current_log_format = get_log_format(server)
 if (log_format == current_log_format):
  _LOG.debug('%s already contains the provided format.', setting)
  return True
 _set_wmi_setting('IIsSmtpServerSetting', setting, format_id, server)
 new_log_format = get_log_format(server)
 ret = (log_format == new_log_format)
 if ret:
  _LOG.debug('Setting %s configured successfully: %s', setting, log_format)
 else:
  _LOG.error('Unable to configure %s with value: %s', setting, log_format)
 return ret

def set_log_format ( log_format , server = _DEFAULT_SERVER ) : setting = 'LogPluginClsid' log_format_types = get_log_format_types ( ) format_id = log_format_types . get ( log_format , None ) if ( not format_id ) : message = "Invalid log format '{0}' specified. Valid formats: {1}" . format ( log_format , log_format_types . keys ( ) ) raise SaltInvocationError ( message ) _LOG . debug ( "Id for '%s' found: %s" , log_format , format_id ) current_log_format = get_log_format ( server ) if ( log_format == current_log_format ) : _LOG . debug ( '%s already contains the provided format.' , setting ) return True _set_wmi_setting ( 'IIsSmtpServerSetting' , setting , format_id , server ) new_log_format = get_log_format ( server ) ret = ( log_format == new_log_format ) if ret : _LOG . debug ( 'Setting %s configured successfully: %s' , setting , log_format ) else : _LOG . error ( 'Unable to configure %s with value: %s' , setting , log_format ) return ret
set the active log format for the smtp virtual server .