fix(engine) #5543: expose the logger implementation through GlobalConfiguration - #5689
Conversation
…figuration The logger choice was readable only from the raw arcadedb.log.impl system property, which LogManager reads from its static initializer. That made it the only ArcadeDB setting outside the configuration system, and unreachable for an application whose own configuration runs after the class is first touched. Add GlobalConfiguration.LOG_IMPL, whose callback installs the matching logger on the running LogManager. LogManager keeps reading the system property directly: querying the configuration from its static initializer would run the whole of GlobalConfiguration's initialization, callbacks included, while instance() is still null. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Tick the box to add this pull request to the merge queue (same as
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage 90.00% diff coverage · -7.66% coverage variation
Metric Results Coverage variation ✅ -7.66% coverage variation Diff coverage ✅ 90.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (e64160a) 150064 114578 76.35% Head commit (4ddcba4) 182065 (+32001) 125060 (+10482) 68.69% (-7.66%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#5689) 10 9 90.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Code Review - PR #5689: expose the logger implementation through
|
… LOG_IMPL spelling Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review: PR #5689 - expose logger implementation through
|
…ale with createLogger Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review: expose the logger implementation through
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Answering the two points that asked for an explicit decision, and closing out the rest. 1. An unrecognized value is stored verbatim - intended. The alternative, storing 2. 4. Double normalization is inherent: 3. Test isolation - declining consistently with the previous cycle. 5. Agreed, and unchanged from #5361. |
Review: expose the logger implementation through
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review: expose arcadedb.log.impl through GlobalConfiguration (#5689)Overall this is a clean, well-reasoned change. The design correctly threads the one-directional wiring (system property read directly at static-init time, GlobalConfiguration.LOG_IMPL driving setLogger() afterwards) and the PR description / docs/5543-*.md do an excellent job pre-empting most reviewer questions. Tests are written test-first, cover the meaningful paths (post-startup swap, case/whitespace normalization, unknown-value fallback + System.err reporting, fromJSON), and are correctly restored in @AfterEach. Verified against the source: the createLogger(String) extraction, the volatile promotion, setValue()s callback-before-allowed ordering, and readConfiguration()s setValue path all line up with the reasoning given. A few observations, none blocking: Correctness / behavior
Security
Minor / nits
Test coverage LGTM. Careful piece of work with unusually thorough documentation of the tradeoffs. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5689 +/- ##
============================================
- Coverage 67.53% 66.69% -0.84%
- Complexity 0 1118 +1118
============================================
Files 1770 1770
Lines 150064 150073 +9
Branches 31807 31808 +1
============================================
- Hits 101342 100094 -1248
- Misses 35527 36946 +1419
+ Partials 13195 13033 -162 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #5543
Since #5361 the logger implementation is selected with the
arcadedb.log.implsystem property, read inLogManager.createLogger()through a directSystem.getProperty(...)call. That made it the only ArcadeDB setting outside ArcadeDB's own configuration system: it never appeared indumpConfigAtStartupor any config-file mechanism, and becausecreateLogger()runs from theLogManagerstatic initializer, the value had to be set before the class was first touched, which a framework-managed application (Spring Boot) cannot always guarantee. This addsGlobalConfiguration.LOG_IMPL(arcadedb.log.impl,SCOPE.JVM, defaultdefault), whose callback installs the matching logger on the runningLogManagervia the extractedLogManager.createLogger(String). The system property keeps working through the very same resolution routine, so behaviour is unchanged when the setting is not touched.LogManagerdeliberately still reads the raw property rather than the configuration, because queryingGlobalConfigurationfrom its static initializer would run that class's whole initialization, callbacks included, whileLogManager.instance()is stillnull- the callback null-guards for the same reason. The issue's nit is folded in:setLogger(Logger)now has javadoc.Test plan
LogImplConfigurationTestwritten first: did not compile before the fix (cannot find symbol: variable LOG_IMPL)LOG_IMPLtoslf4jafter startup installsSlf4jLogger; setting it back toDEFAULT(case-insensitive) installsDefaultLoggerDefaultLoggerand is reported onSystem.err, matching the system-property behaviour from Add opt-in SLF4J facade logging (Slf4jLogger), keeping java.util.logging as default (#4276) #5361GlobalConfiguration.fromJSON(...), and appears indumpConfigurationslf4j/bogus, crossed withLogManagervsGlobalConfigurationloaded first. All four install the expected logger (seedocs/5543-log-impl-global-configuration.mdfor the table)mvn -pl engine test: 10690 tests, 0 failures, 0 errors, 23 skippedmvn compileover the full reactor: green🤖 Generated with Claude Code