<blockquote>
<p><strong>when I looking to a debug.log I don't see anything about blocks. Is it possible?</strong></p>
</blockquote>
<p>I expect the <code>net</code> category of log information should contain entries relating to the exchange of blocks with peers but I would not expect the full block data to be logged.</p>
<p>The name of the debug log suggests it is mainly intended as a way to investigate problems, and not intended as a means to routinely extract block data. You should use the RPC API for that.</p>
<hr />
<p>Related</p>
<ul>
<li><a href="https://bitcoin.stackexchange.com/q/66892/13866">What are the debug categories?</a></li>
<li><a href="https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)" rel="nofollow noreferrer">API reference (JSON-RPC)</a></li>
<li><a href="https://bitcoincore.org/en/doc/0.20.0/rpc/blockchain/getblock/" rel="nofollow noreferrer">getblock</a></li>
</ul>

CC BY-SA 4.0
2020-07-31T09:51:19.710Z
2020-07-31T09:51:19.710Z
RedGrittyBrick
<p>I'm new in the Bitcoin world, but I want do the script. The script will read &quot;blocks&quot; from debug.log, but now when I looking to a debug.log I don't see anything about blocks. Is it possible?</p>
<p>Here is example from my log:</p>
<blockquote>
<p>[D:2020-04-13T18:58:49Z] (mempool) Added 30e28c7a2ad288fa3457569423b388f43e0b874032dd14c8bfc1db49777c6746 to mempool (txs=3182).
[D:2020-04-13T18:58:50Z] (net) Requesting 1/1 txs from peer with getdata (131.188.40.191:8333).
[D:2020-04-13T18:58:50Z] (mempool) Added 0ee02ea46ea6c06a3c0addcf651612f8681272310f583f2bd3f273d0c14c3cf0 to mempool (txs=3183).
[D:2020-04-13T18:58:50Z] (net) Requesting 6/6 txs from peer with getdata (194.15.231.236:8333).
[D:2020-04-13T18:58:50Z] (mempool) Added 86e5a85abc674e432aeffef3876772ea8588dc2cdab79ed236041b8875a171e7 to mempool (txs=3184).
[D:2020-04-13T18:58:50Z] (mempool) Added fc5c9d831785b1e43b0f9adb4333d7ed23562b332a061f958f7f98dcd5397043 to mempool (txs=3185).
[D:2020-04-13T18:58:50Z] (mempool) Added 5742cd2c1f376720596ee0256ca825b2940cf22b7b6e681c3666b46fb72fe144 to mempool (txs=3186).
[D:2020-04-13T18:58:50Z] (mempool) Added e8222822f1fba4fb8dd4d2aa60e6d42b38f2ef35c98e09f81961d72c4502beb1 to mempool (txs=3187).
[D:2020-04-13T18:58:50Z] (mempool) Added 123d121ec06bf8cfaeefb5ba25ed303fa82ee75e8179452cfb4be80d7cfd7161 to mempool (txs=3188).
[D:2020-04-13T18:58:50Z] (mempool) Added 59b40a817ffc223361ec07874abb889d0769c8bb6155cb6cdf175680221a0f77 to mempool (txs=3189).</p>
</blockquote>

CC BY-SA 4.0
2020-07-30T15:35:53.080Z
What is "the script"?
Ava Chow
CC BY-SA 4.0
2020-07-30T15:39:43.147Z
debug.log is just a software level log; you should not rely on it for any serious data, as it offers no actual way to verify anything
Raghav Sood
<bitcoin-core>
Read block info from log
Tom Pospíšil
# Read block info from log

(Asked by: username_0 on 2020-07-30)

I'm new in the Bitcoin world, but I want do the script. The script will read "blocks" from debug.log, but now when I looking to a debug.log I don't see anything about blocks. Is it possible?

Here is example from my log:

> [D:2020-04-13T18:58:49Z] (mempool) Added 30e28c7a2ad288fa3457569423b388f43e0b874032dd14c8bfc1db49777c6746 to mempool (txs=3182).
> [D:2020-04-13T18:58:50Z] (net) Requesting 1/1 txs from peer with getdata (131.188.40.191:8333).
> [D:2020-04-13T18:58:50Z] (mempool) Added 0ee02ea46ea6c06a3c0addcf651612f8681272310f583f2bd3f273d0c14c3cf0 to mempool (txs=3183).
> [D:2020-04-13T18:58:50Z] (net) Requesting 6/6 txs from peer with getdata (194.15.231.236:8333).
> [D:2020-04-13T18:58:50Z] (mempool) Added 86e5a85abc674e432aeffef3876772ea8588dc2cdab79ed236041b8875a171e7 to mempool (txs=3184).
> [D:2020-04-13T18:58:50Z] (mempool) Added fc5c9d831785b1e43b0f9adb4333d7ed23562b332a061f958f7f98dcd5397043 to mempool (txs=3185).
> [D:2020-04-13T18:58:50Z] (mempool) Added 5742cd2c1f376720596ee0256ca825b2940cf22b7b6e681c3666b46fb72fe144 to mempool (txs=3186).
> [D:2020-04-13T18:58:50Z] (mempool) Added e8222822f1fba4fb8dd4d2aa60e6d42b38f2ef35c98e09f81961d72c4502beb1 to mempool (txs=3187).
> [D:2020-04-13T18:58:50Z] (mempool) Added 123d121ec06bf8cfaeefb5ba25ed303fa82ee75e8179452cfb4be80d7cfd7161 to mempool (txs=3188).
> [D:2020-04-13T18:58:50Z] (mempool) Added 59b40a817ffc223361ec07874abb889d0769c8bb6155cb6cdf175680221a0f77 to mempool (txs=3189).

**Tags:** bitcoin-core

> **Comments:**
> **username_1**: What is "the script"?  
> **username_2**: debug.log is just a software level log; you should not rely on it for any serious data, as it offers no actual way to verify anything  

---

## 1 answers

### Answer by username_3 on 2020-07-31. Score: 1 | Accepted answer

> **when I looking to a debug.log I don't see anything about blocks. Is it possible?**

I expect the `net` category of log information should contain entries relating to the exchange of blocks with peers but I would not expect the full block data to be logged.

The name of the debug log suggests it is mainly intended as a way to investigate problems, and not intended as a means to routinely extract block data. You should use the RPC API for that.

---

Related

* [What are the debug categories?](https://bitcoin.stackexchange.com/q/66892/13866)
* [API reference (JSON-RPC)](https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))
* [getblock](https://bitcoincore.org/en/doc/0.20.0/rpc/blockchain/getblock/)


---

