IPFS Logging configuration


I am trying to find the ipfs logs for content upload, download and the logs when an ipfs node in a cluster replicates the data to all other nodes.
I know we can check ipfs logs using ipfs log tail, but I can’t see logs having info for the operations I am looking for?

Also, can we configure all the logs to be written to a file just like ipfs cluster rest api.

Just use IPFS_LOGGING environment variable to set the level. The level set is standard: debug, info, warn, error, dpanic, panic, fatal. After setting of this variable, the daemon will throw the log messages of the selected level to stderr

1 Like

If you are using systemd service unit, there is the way to configure output for the logs inside .service file:

# It is possible also to set the output as a filestore: 'file:/var/log/<ipfs-log-file>' in systemd 2.36 or newer
1 Like

Thanks :+1: @twdragon

@twdragon , Thanks again.

I tried and was able to see the logs when I call the cluster API for adding content
http:// ipfs-node:9094/add

But for some reason, the logs are not generated when I try to get the data from gateway URL
http:// ipfs-node:8080/ipfs/filehash

any thoughts?

Did you try to turn logging to debug?

Yes, tried debug too.

I did set the env variable using export IPFS_LOGGING=debug but no logs were getting generated, so I tried ipfs log level all debug and I saw many logs populating.

Yet, logs for gateway api while fetching the data are still not generating.