Where is debug.log file in Bitcoin source code?


I am running 64bit Ubuntu 17.04, I am following this tutorial for creating a new altcoin. I am up to section 7, here to be exact:

The first time you run the compiled code (daemon or qt), it will say "assertion failed". Just exit the program, go to config dir (under AppData/Roaming), open the debug.log, get the hash after "block.GetHash() = ", copy and paste it to the beginnig of main.cpp, hashGenesisBlock. Also get the merkle root in the same log file, paste it to the ... position in the following code, in LoadBlockIndex()

I am struggling to find the debug.log file, and so cannot get my hashes to continue. This guide is quite old (4 years) and I think is for setting up an altcoin on Windows.

Where is my debug.log file? If it doesn't exist, what is my next step?

Barney Chambers

Posted 2017-11-14T01:55:20.230

Reputation: 333

1Just as general advice, 4 years ago is an eternity in cryptocurrency time. I would not count on any information that old still being correct or usable. – Nate Eldredge – 2017-11-14T04:37:11.993

It's the only information around unfortunately! – Barney Chambers – 2017-11-14T06:38:33.453



On Unix systems the debug.log file, as well as all other files created by the client (blockchain data, databases, etc) are placed by default in ~/.bitcoin; that is, a subdirectory of your home directory named .bitcoin. If you have used -datadir to set a different data directory, debug.log will be placed there instead.

Note that the ls command normally will not show files or directories that start with ., so you won't see this if you just ls your home directory. But you can still cd there, or use ls -a to see it.

Nate Eldredge

Posted 2017-11-14T01:55:20.230

Reputation: 22 182

I think this is outdated information Nate, I think all the code that produced this file has been removed from the Bitcoin code around 2014. – Barney Chambers – 2017-11-14T11:18:30.747

No, I don't think so. You can see at https://github.com/bitcoin/bitcoin/blob/a1f7f1870931fe978069482ec0f7dc7d59456966/src/util.cpp#L192 in the current version where debug.log is opened. Additionally, I just tested v0.15.0 and the file is still written.

– Nate Eldredge – 2017-11-14T16:45:31.543