-1

I want to set some data in the Log field in a transaction using Ethereum, i used in smart contract event method but i got always empty logs could anyone help me please? Thank you

  • your question is unclear, what code did you use to generate the event, and what do you mean by log field? please elaborate more. – Badr Bellaj Jun 1 '17 at 15:00
  • When you retrieve logs the request usually take about 5 to 10 seconds on testnet. Also posting your code should be helpful. – webjunkie Jun 1 '17 at 15:13
  • @BadrBellaj log column in a transaction body. – MyHMEG Jun 1 '17 at 20:42
2

A transaction's receipt is only generated if the transaction ends in success. If the transaction ran out of gas or threw an exception, the receipt will not be generated. The first thing I would check is that the transaction ended without error.

If the transaction ended successfully, then the next most likely cause of no log would be that you're querying the node incorrectly.

As mentioned, in either case, example code would help come up with a better answer.

  • Thank you very much !! and how i can add some logs when the transaction ends in success please? – MyHMEG Jun 1 '17 at 20:43
  • In your Solidity code, you first must define an event, and then wherever you want that log to appear, you call it in your functions. – Thomas Jay Rush Jun 2 '17 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.