1 2018-06-13 17:34:28 <satwo> Hi all. Can anyone recommend a way to truncate and copy/archive debug.log when running Bitcoind? When capturing everything (debug=1 in bitcoin.conf) the file size increases very rapidly. I looked into logrotate in Ubuntu but there is some data loss while the in between the copying and truncating, which is less than ideal.
2 2018-06-13 18:59:12 <jimpo> satwo: Have you checked out the -shrinkdebugfile option?
3 2018-06-13 19:00:10 <jimpo> It doesn't archive, just truncates
4 2018-06-13 19:00:45 <satwo> jimpo, yup - I like the truncate part, but archiving is what I'm mainly after :)
5 2018-06-13 19:01:24 <satwo> I figure there should be a way to do it without any data loss, but that's appearing to be tougher than I expected
6 2018-06-13 19:01:59 <jimpo> Sounds like you're well on you way to building a log pipeline then :-)
7 2018-06-13 19:03:15 <satwo> Would this be a bitcoin core PR? I'd be happy to do it, and in fact was just writing something about that on #bitcoin-core-dev
8 2018-06-13 19:07:05 <echeveria> satwo: it would be something for there, yes. you might get away with a hack like wiring the ZMQ interface to the logger.
9 2018-06-13 19:10:44 <satwo> echevaria: what do you mean exactly?
10 2018-06-13 19:10:51 <satwo> *echeveria
11 2018-06-13 19:23:12 <satwo> Actually I think I see what you mean. Interesting idea...
12 2018-06-13 20:24:25 <jimpo> eh, I wouldn't use ZMQ. You can just redirect stdout to any log handling process.
13 2018-06-13 20:24:46 <jimpo> I think it's best to keep it out of Core. Unix is a beautiful thing.
14 2018-06-13 21:01:03 <satwo> Still a (relative) Unix noob. But I think redirecting stdout with split is the way forward