Bitcoin Forum
June 25, 2018, 12:53:06 AM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: debug.log getting bigger  (Read 2122 times)
Belkaar
Full Member
***
Offline Offline

Activity: 174
Merit: 100


View Profile WWW
May 19, 2011, 08:53:32 PM
 #1

Hi there,

is there a possibility to get bitcoind to not write that much (anything) to debug.log?
It gets kinda big.

Thanks

bitcoinCodes.com: Get XBox live, PSN and WoW game time codes fast and anonymously
Android RPC client: Bitcoiner
Bitmessage: BM-GtcxVju35PGuD6es9vrF1SXtCVxScbjB
1529887986
Hero Member
*
Offline Offline

Posts: 1529887986

View Profile Personal Message (Offline)

Ignore
1529887986
Reply with quote  #2

1529887986
Report to moderator
The World's Betting Exchange

Bet with play money. Win real Bitcoin. 5BTC Prize Fund for World Cup 2018.

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1529887986
Hero Member
*
Offline Offline

Posts: 1529887986

View Profile Personal Message (Offline)

Ignore
1529887986
Reply with quote  #2

1529887986
Report to moderator
1529887986
Hero Member
*
Offline Offline

Posts: 1529887986

View Profile Personal Message (Offline)

Ignore
1529887986
Reply with quote  #2

1529887986
Report to moderator
xf2_org
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
May 20, 2011, 12:08:27 AM
 #2


There is one pull request along those lines.

theymos
Administrator
Legendary
*
Offline Offline

Activity: 3066
Merit: 3201


View Profile
May 20, 2011, 02:00:55 AM
 #3

Bitcoin will truncate debug.log when you restart it.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Vladimir
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000


-


View Profile
May 22, 2011, 10:04:39 AM
 #4

I wish there was some command line option which would make bitcoind sending logs to stout or stderr instead of that stupid debug.log file.

-
xf2_org
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
May 22, 2011, 04:18:08 PM
 #5

Bitcoin will truncate debug.log when you restart it.

eh?  No, it does not truncate debug.log at startup.

xf2_org
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
May 22, 2011, 04:18:25 PM
 #6

I wish there was some command line option which would make bitcoind sending logs to stout or stderr instead of that stupid debug.log file.

Open an issue at github, this is a reasonable request.

theymos
Administrator
Legendary
*
Offline Offline

Activity: 3066
Merit: 3201


View Profile
May 22, 2011, 07:06:50 PM
 #7

eh?  No, it does not truncate debug.log at startup.

util.cpp:
Code:
void ShrinkDebugFile()
{
    // Scroll debug.log if it's getting too big
    string strFile = GetDataDir() + "/debug.log";
    FILE* file = fopen(strFile.c_str(), "r");
    if (file && GetFilesize(file) > 10 * 1000000)
    {
        // Restart the file with some of the end
        char pch[200000];
        fseek(file, -sizeof(pch), SEEK_END);
        int nBytes = fread(pch, 1, sizeof(pch), file);
        fclose(file);
        if (file = fopen(strFile.c_str(), "w"))
        {
            fwrite(pch, 1, nBytes, file);
            fclose(file);
        }
    }
}

init.cpp (at startup, just before writing the debug.log "header"):
Code:
    if (!fDebug && !pszSetDataDir[0])
        ShrinkDebugFile();
    printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
    printf("Bitcoin version %s%s beta\n", FormatVersion(VERSION).c_str(), pszSubVer);

This feature actually annoys me, since I like to archive my debug.log. (I've disabled it on mine.)

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!