Bitcoin Forum
December 05, 2016, 04:33:49 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: debug.log getting bigger  (Read 1968 times)
Belkaar
Full Member
***
Offline Offline

Activity: 174


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
1480912429
Hero Member
*
Offline Offline

Posts: 1480912429

View Profile Personal Message (Offline)

Ignore
1480912429
Reply with quote  #2

1480912429
Report to moderator
1480912429
Hero Member
*
Offline Offline

Posts: 1480912429

View Profile Personal Message (Offline)

Ignore
1480912429
Reply with quote  #2

1480912429
Report to moderator
1480912429
Hero Member
*
Offline Offline

Posts: 1480912429

View Profile Personal Message (Offline)

Ignore
1480912429
Reply with quote  #2

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

Posts: 1480912429

View Profile Personal Message (Offline)

Ignore
1480912429
Reply with quote  #2

1480912429
Report to moderator
1480912429
Hero Member
*
Offline Offline

Posts: 1480912429

View Profile Personal Message (Offline)

Ignore
1480912429
Reply with quote  #2

1480912429
Report to moderator
1480912429
Hero Member
*
Offline Offline

Posts: 1480912429

View Profile Personal Message (Offline)

Ignore
1480912429
Reply with quote  #2

1480912429
Report to moderator
xf2_org
Member
**
Offline Offline

Activity: 70


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


There is one pull request along those lines.

theymos
Administrator
Legendary
*
Offline Offline

Activity: 2492


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


-


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: 70


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: 70


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: 2492


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!