Sounds familiar... You can create a Class who's job it is to collect your StoreMyLogs__c records, and eventually commit them to the database.
You can pass your HttpRequest and HttpResponse along to a static list in that Class using a static method immediately after your HTTP.send(request) methods in your future/helper/wherever in the execution context.
Then (here's the tricky bit) just before the return statement in your future Class, call another static method to commit your list of StoreMyLogs__c records...
global class CalloutLogs {
public static list<StoreMyLogs__c> logEntries {get;set;} //need a static variable to avoid the pending work exception
static{
logEntries = new list<StoreMyLogs__c>(); //We want to make sure that we have an instance of the static var
}
public static StoreMyLogs__c log(HttpRequest request, HttpResponse response){
//Converts HttpRequest and HttpResponse to string representations
//Creates a StoreMyLogs__c record, and adds it to the static list<StoreMyLogs__c> member
//Returns the StoreMyLogs__c record that was converted
StoreMyLogs__c returnLog = new StoreMyLogs__c ();
//marshal your request and response into your StoreMyLogs__c
//...
logEntries.add(returnLog);
return returnLog;
}
public static string commitLogs(){
string returnString = 'Failed to commit StoreMyLogs__c ...';
if(logEntries != null){
if(logEntries.size() == 0){
returnString = 'No StoreMyLogs__c to commit...';
} else {
insert logEntries;
returnString = 'Committed ' + logEntries.size() + ' StoreMyLogs__c Entries';
}
}
return returnString;
}
}
THEN: just before you return from your future method... call the commitLogs()
method.
system.debug(CalloutLogs.commitLogs());
return; //like the absolute final return!
You just need to make sure that you commit only after ALL callouts have been made to avoid the dreaded "pending work" exception.