Get Logs

Reviewing the logs from a node can be useful when attempting to debug issues with contracts or the node itself. Logs can also be useful at finding choke points or memory issues within your contracts.

Return logs from a remote node: mvn aion4j:get-logs

In order to have a node return logs, you must specify:

  • The node host and port variables.
  • The starting (fromBlock) and ending (toBlock) blocks that you wish to capture log data for. Log data will be returned inclusive of these blocks.
  • The address or addresses that you wish to capture log data.
mvn aion4j:get-logs
    -DfromBlock=<FROM BLOCK>
    -Dtopics=<TOPICS optional>
    -Dblockhash=<BLOCKHASH optional>

For example:

mvn aion4j:get-logs -Dweb3rpc.url=http://host:port [-DfromBlock=<blockno>] [-DtoBlock=<blockno>] [-Daddress=[comma separated addresses]] [-Dtopics=[comma separated topics]] [-Dblockhash=<blockhash>] -Premote