lbrycrdd should have a logroll if its printing console output to logs. #211
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
hard fork
help wanted
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
soft fork
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
work in progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbrycrd#211
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Since it prints every line about every bit of indexing that it does it should be able to roll the log file a bit so that you don't end up with a full blockchain sized log file.
I think we should also audit what is currently being written to debug.log.
I removed the biggest culprit here, this would dump about 200mb worth of stuff on every claimtrie flush:
7eca4f00a7
Did an audit of the other logs, they don't cause too much of a problem in terms of the volume of logs. However their are a bunch of unnecessary logging that can be omitted.
These definitely should be removed, as they serve no useful purpose other than debugging for devs:
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L608
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L614
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L1598
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L1629
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L1945
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L2111
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L2384
Below could be removed they do show some useful claim information (for example, a new claim gets created), but not sure if that's something that should go into the logs.
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L58
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L65
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L1592
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L1611
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L1697
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L2001
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L2020
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L2098
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L2105
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L2163
https://github.com/lbryio/lbrycrd/blob/v0.12.2.2/src/claimtrie.cpp#L2215
Your assessment looks good. I think we should also remove those 7 you suggest. I think we should keep a log entry for each user addition/subtraction, so I think most on the bottom list should stay. It looks like we may be logging added claims twice, though -- both add and insert?
I'm worried of this line too ->
80940714a1 (diff-1f647c4b5527c3d3e86cfb735380b479R60)
@bvbfan , I do have that line removed in my normalization work.
The fixes in this release https://github.com/lbryio/lbrycrd/releases/tag/v0.12.2.3 will remove much of the unnecessary logging. lbrycrdd has a function that will automatically shrink large log files upon startup, so we will not implement a log roll/rotation.
Users that want a log roll/rotation should implement their own (the automatic shrinking of log files can be disabled through option -shrinkdebugfile )
I propose that we start a new file with each run, and that we backup the old file. Hence, I should always have this run and the previous one available. That's not quite a "roll" of logs, in that it won't fix the maximum size while the daemon is running, but I think it would help.
@BrannonKing can I work on this to implement what you described in your last comment?
@gahag , yes you can work on this.
I've explored the code, and I'm thinking of implementing in
BCLog::Logger::OpenDebugLog
. The code would move the debug file if it exists to a.old
file. This way, each file would correspond to one execution of the entire application. Another option would be to implement such code in the default constructor forBCLog::Logger
. What do you guys think?Look at the top of
AppInitMain()
; the "shrink" code there would also need to change.Sure. What are we expecting to be the new behavior of the -shrinkdebugfile flag? Should it be removed, or should it shrink the old log file?
I think the flag should be removed.
This looks like it should've been closed by #344 I don't have time to really validate this functionality but if people see this PR didn't hit the notes that this thread evolved to hit then please feel free to re-open it.