I deployed and tested eosio smart contract. I want to record the logs of a smart contract using the web API. How can I do this? I searched but didn't get any satisfying answer. I tried to get logs by accessing actions, using eos-sharp in C# as follow:
try
{
UInt64 sequence; UInt32 blocknumber; DateTime datetime; string actionaname; String Receiver; String Trxid;
var r = getEos();
var resultaction = await r.GetActions(constants.LOCALCODEACCOUNT, 0, 20);
string jsondata = ""; string finalresult = "";
string globalActionJson = JsonConvert.SerializeObject(resultaction);
foreach (GlobalAction action in resultaction.actions)
{
var test = action.action_trace.act;
sequence = Convert.ToUInt64(action.account_action_seq);
blocknumber = Convert.ToUInt32(action.block_num);
datetime = Convert.ToDateTime(action.block_time);
actionaname = test.name.Trim();
Receiver = action.action_trace.receipt.receiver.Trim();
Trxid = action.action_trace.trx_id.Trim();
var dataarguments = JsonConvert.SerializeObject(test.data);
dataarguments = "[" + dataarguments + "]";
jsondata += "{\"Sequence\":" + sequence + ",\"Block Number\":\"" + blocknumber + "\",\"Datetime\":\"" + datetime + "\",\"Action\":\"" + actionaname + "\",\"Receiver\":\"" + Receiver + "\",\"TransactionID\":\"" + Trxid + "\",\"Data\":" + dataarguments + "}"+",";
}
string removecomma = jsondata.Remove(jsondata.Length - 1);
finalresult = "{\"Actions\":[" + removecomma + "]" + "}";
JsonConvert.SerializeObject(finalresult);
return finalresult;
}
catch (Exception ex)
{
return ex.Message;
}
But here the problem is I can get only a certain number of actions. I need all the actions. Any help would be appreciated.