feat(log): improve log for gRPC, DB, and shutdown#6700
Open
halibobo1205 wants to merge 7 commits intotronprotocol:developfrom
Open
feat(log): improve log for gRPC, DB, and shutdown#6700halibobo1205 wants to merge 7 commits intotronprotocol:developfrom
halibobo1205 wants to merge 7 commits intotronprotocol:developfrom
Conversation
### What Changed - gRPC now appear in the application log instead of going only to standard error. - Database size stats are no longer printed at info level during startup, which reduces log noise. - Shutdown now waits longer before stopping the log system, giving pending messages more time to flush. - Async appender now allows up to 5 seconds to drain its queue on shutdown. - Interrupted shutdowns now show a clearer log message. - Test log config is INFO level. ### Impact `✅ Fewer missed gRPC error logs` `✅ Cleaner startup output` `✅ Fewer lost shutdown logs` `✅ Fewer test logs`
Collaborator
Author
|
The coverage delta is dominated by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #6583.
Six operator-facing logging improvements:
tron.log. InstallSLF4JBridgeHandler(jul-to-slf4j) at the earliest startup point so grpc-java's JUL output is routed through Logback instead of bypassing it to stderr;io.grpcinherits root INFO soNettyServerTransport's"Transport failed"JUL-INFO diagnostics (TLS handshake failures, unexpected resets, and other non-quiet exceptions) actually reachtron.log.DbStat.statProperty()moved to DEBUG — critical init messages are no longer buried.TronLogShutdownHookrefactored: constants named, max wait raised from 60 s to 180 s to give the node's executor pools realistic headroom to drain (each pool can take up to 120 s viaExecutorServiceManager.shutdownAndAwaitTermination).TransactionCapsule.logSlowSigVerify(...)emits INFO for any single verify > 50 ms.LevelDbDataSourceImplwraps the JNI-blockingfactory.open(...)in a watchdog: WARN after 60 s with a remediation hint pointing atToolkit.jar db archive.--log-configfails fast.LogService.load(...)throwsTronError(ErrCode.LOG_LOAD)on an unreadable--log-configpath. Previously, it silently fell back to the classpath default, misleading operators into thinking their custom config was active.Impact
tron.log; startup no longer dumps DB stats at INFO; a stuck LevelDBfactory.openemits one actionable WARN every 30 s pointing atToolkit.jar db archive.DEBUGtoINFOto reduce CI log volume so failures are easier to locate after a red build. Tests that genuinely rely on DEBUG opt in per-logger inlogback-test.xml.Release scope
Logging-only change: no API, no RPC, no network, no DB format change.