<p>Do you really want packet level information?</p>
<p>If so, search the internet for network tools like 'wireshark' or 'tcpdump' and log IP/port traffic that is of interest.</p>
<p>If you want application level messages you can set your node logging to <code>debug</code> instead of the default <code>info</code> to get a heap more information from your node. This change will require a restart of your node.</p>

CC BY-SA 4.0
2022-05-05T20:48:50.277Z
Hi, thank you for your response. I changed the log file to debug and enabled logging for all the application level P2P mini-protocols. With regards to the packet level information, I wanted to collect the block information that is exchanged from specific peers along with their addresses. Wireshark/TCP dump traffic does not collect readable data. I assume the connections are encrypted.
secengdev_99
CC BY-SA 4.0
2022-08-24T20:16:18.910Z
I think TCP is used directly and that the connections aren't encrypted. Deserializing the raw packets will of course be a major hassle
Christian Schmitz
CC BY-SA 4.0
2022-05-04T04:50:19.830Z
2022-05-04T04:50:19.830Z
MC_Brisbane - JUST Pool
<p>I am trying to collect as much information as possible from a running Cardano node. Is there a way we can log the messages/packets exchanged between nodes in the Cardano P2P network?</p>
<p>Thank you.</p>

CC BY-SA 4.0
2022-05-03T05:31:35.087Z
Can you give us more information? Which platform are you running on? How did you install cardano-node? As a service(systemd) or in another way? Do you need all cardano-node logs or just part of it?
Nic_T2H
CC BY-SA 4.0
2022-05-05T20:50:10.017Z
Hi, thank you for your response. I set up the cardano-node using the NIX package manager. I wanted to set it up as a service but could not find the documentation on how to do so. I would like to collect as much data as possible.
secengdev_99
CC BY-SA 4.0
2022-05-09T05:21:04.067Z
Hi, maybe this link could help you, what you need to do is to create a script to start the node and then create a service and enable it, let me know if you need help on setting things up

https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node/part-ii-configuration/creating-startup-scripts

After that, you can check logs using "journalctl" command
Nic_T2H
CC BY-SA 4.0
2022-05-10T21:53:33.560Z
Thank You @Nic_T2H, I will check out the steps. It seems to be a promising way to go about it. Doing this with NIX can get messy. The service will surely be the cleaner solution.
secengdev_99
CC BY-SA 4.0
2022-05-11T05:31:24.410Z
Good, let me know if you need help :-)
Nic_T2H
<cardano-node>
How do I log all individual network messages in the cardano-node within a file?
# How do I log all individual network messages in the cardano-node within a file?

(Asked by: username_0 on 2022-05-01)

I am trying to collect as much information as possible from a running Cardano node. Is there a way we can log the messages/packets exchanged between nodes in the Cardano P2P network?

Thank you.

**Tags:** cardano-node
> **Comments:**
> **username_1**: Can you give us more information? Which platform are you running on? How did you install cardano-node? As a service(systemd) or in another way? Do you need all cardano-node logs or just part of it?  
> **username_0**: Hi, thank you for your response. I set up the cardano-node using the NIX package manager. I wanted to set it up as a service but could not find the documentation on how to do so. I would like to collect as much data as possible.  
> **username_1**: Hi, maybe this link could help you, what you need to do is to create a script to start the node and then create a service and enable it, let me know if you need help on setting things up  https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node/part-ii-configuration/creating-startup-scripts  After that, you can check logs using "journalctl" command  
> **username_0**: Thank You @Nic_T2H, I will check out the steps. It seems to be a promising way to go about it. Doing this with NIX can get messy. The service will surely be the cleaner solution.  
> **username_1**: Good, let me know if you need help :-)  

---

## 1 answers

### Answer by username_2 on 2022-05-04. Score: 0

Do you really want packet level information?

If so, search the internet for network tools like 'wireshark' or 'tcpdump' and log IP/port traffic that is of interest.

If you want application level messages you can set your node logging to `debug` instead of the default `info` to get a heap more information from your node. This change will require a restart of your node.

> **Comments:**
> **username_0**: Hi, thank you for your response. I changed the log file to debug and enabled logging for all the application level P2P mini-protocols. With regards to the packet level information, I wanted to collect the block information that is exchanged from specific peers along with their addresses. Wireshark/TCP dump traffic does not collect readable data. I assume the connections are encrypted.  
> **username_3**: I think TCP is used directly and that the connections aren't encrypted. Deserializing the raw packets will of course be a major hassle  

---

