params = {
                "ApexCode"          : "None",
                "ApexProfiling"     : "01pd0000001yXtYAAU",
                "Callout"           : True,
                "Database"          : 1,
                "ExpirationDate"    : 3,
                "ScopeId"           : "",
                "System"            : "",
                "TracedEntityId"    : "",
                "Validation"        : "",
                "Visualforce"       : "",
                "Workflow"          : ""
            }

def execute(self):
        """
            params = {
                "ApexCode"          : "None",
                "ApexProfiling"     : "01pd0000001yXtYAAU",
                "Callout"           : True,
                "Database"          : 1,
                "ExpirationDate"    : 3,
                "ScopeId"           : "",
                "System"            : "",
                "TracedEntityId"    : "",
                "Validation"        : "",
                "Visualforce"       : "",
                "Workflow"          : ""
            }
        """
        if 'type' not in self.params:
            raise MMException("Please include the type of log, 'user' or 'apex'")
        if 'debug_categories' not in self.params:
            raise MMException("Please include debug categories in dictionary format: e.g.: {'ApexCode':'DEBUG', 'Visualforce':'INFO'}")

        request = {}
        if self.params['type'] == 'user':
            request['ScopeId'] = None
            request['TracedEntityId'] = self.params.get('user_id', config.sfdc_client.user_id)
        elif self.params['type'] == 'apex':
            #request['ScopeId'] = 'user'
            request['ScopeId'] = config.sfdc_client.user_id
            request['TracedEntityId'] = self.params['apex_id']

        for c in self.params['debug_categories']:
            if 'category' in c:
                request[c['category']] = c['level']
            else:
                request[c] = self.params['debug_categories'][c]

        request['ExpirationDate'] = util.get_iso_8601_timestamp(int(float(self.params.get('expiration', 30))))

        config.logger.debug(self.params['debug_categories'])
        config.logger.debug("Log creation reuqest--->")
        config.logger.debug(request)

        create_result = config.sfdc_client.create_trace_flag(request)

        config.logger.debug("Log creation response--->")
        config.logger.debug(create_result)

        if type(create_result) is list:
            create_result = create_result[0]
        if type(create_result) is not str and type(create_result) is not unicode:
            return json.dumps(create_result)
        else:
            return create_result