Bitcoin Forum
May 10, 2024, 01:14:44 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: debug.log getting bigger  (Read 2233 times)
Belkaar (OP)
Full Member
***
Offline Offline

Activity: 177
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
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715303684
Hero Member
*
Offline Offline

Posts: 1715303684

View Profile Personal Message (Offline)

Ignore
1715303684
Reply with quote  #2

1715303684
Report to moderator
1715303684
Hero Member
*
Offline Offline

Posts: 1715303684

View Profile Personal Message (Offline)

Ignore
1715303684
Reply with quote  #2

1715303684
Report to moderator
1715303684
Hero Member
*
Offline Offline

Posts: 1715303684

View Profile Personal Message (Offline)

Ignore
1715303684
Reply with quote  #2

1715303684
Report to moderator
xf2_org
Member
**
Offline Offline

Activity: 98
Merit: 13


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


There is one pull request along those lines.

theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12982


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


-


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


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


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: 5194
Merit: 12982


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!