-
Notifications
You must be signed in to change notification settings - Fork 63
Align Chronicle Logger with SLF4J 2.x, re-enable legacy bindings, and tighten agent/requirements docs #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
peter-lawrey
wants to merge
39
commits into
develop
Choose a base branch
from
adv/develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,455
−401
Conversation
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
james-mcsherry
approved these changes
Nov 20, 2025
…proved configuration
…ng message formatting
…d improve compatibility
…ling and enhance log entry validation
… management and compatibility
…-simple for test output
# Conflicts: # logger-log4j-1/src/test/java/net/openhft/chronicle/logger/log4j1/Log4j1ChronicleLogTest.java # logger-log4j-2/pom.xml
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.
Functional changes
1. SLF4J / Log4j / JUL integration and behaviour
SLF4J 2.x as the default provider
logger-slf4j-2is now the primary SLF4J binding (viaSLF4JServiceProvider), with a newSlf4jProviderHealthCheckTestensuring the Chronicle provider is discoverable on the classpath.ChronicleLoggerFactoryin bothlogger-slf4j(1.x) andlogger-slf4j-2now implement a sharedChronicleLoggerFactoryControlinterface and expose areload()hook so tests and tools can reset state consistently.Legacy SLF4J 1.x support and bridges
Re-enabled the
logger-slf4j,logger-logback,logger-log4j-1andlogger-log4j-2modules in the rootpom.xml, so all bindings are built and tested again.Reworked Log4j 1.x integration:
logger-log4j-1now uses pure Log4j 1 APIs in production andslf4j-reload4jtest-scope as the SLF4J bridge for legacy callers.Slf4jBridgeChronicleLogTestverifies that SLF4J log calls still reach the Chronicle Log4j 1 appender via the bridge.Log4j 2 tests now use
org.apache.logging.log4j.Loggerdirectly instead of SLF4J, avoiding accidental provider confusion.JUL / JCL test logging
logger-jclandlogger-jultest dependencies fromslf4j-noptoslf4j-simpleso tests emit visible console output when they fail.AbstractChronicleHandlerinlogger-julnow exposessetPath/getPathso tests can assert handler wiring reliably, andChronicleHandlerConfig’s level parsing is simplified to rely onLevel.parse(..).SLF4J SimpleLogger wiring and error paths
SimpleLoggerConfigurationnow logs configuration failures toSystem.errand prints stack traces instead of using the deprecatedReporter/Util.reporthelpers.SimpleLoggerhas been cleaned up (javadoc, switch default, explicitIllegalStateExceptionfor unknown levels) but preserves upstream semantics; deprecation warnings are suppressed where we intentionally retain 1.x base classes for compatibility.2. Chronicle logging configuration and lifecycle
Configuration loading
ChronicleLogConfig.load(InputStream)now uses try-with-resources, logs a clear error toSystem.erronIOException, and returnsnullinstead of silently swallowing failures.ChronicleLogConfig.getBoolean(..)overloads now normalise values via"true".equalsIgnoreCase(..)and return a concreteBooleaninstead ofnullwhere previously used in defaulted paths; call-sites using thedefvaloverload retain their existing behaviour.Manager and appender resilience
ChronicleLogManager.clear()now logs failures to close individualChronicleLogWriterinstances toSystem.errand continues clearing, instead of silently dropping exceptions.append=falseis configured,newChronicle(..)now logs that queue clearing is not yet supported instead of invoking a code path that throwsUnsupportedOperationException.LogAppenderConfig.setProperty(..)logs a concise error toSystem.errif reflective configuration fails, making mis-typed properties visible.Tools and interrupt handling
ChronicleLogReader.processLogs(..)now honours thread interruption whenwaitForIt=true: onInterruptedExceptionit sets the interrupt flag and breaks out of the loop instead of sleeping indefinitely. This prevents tools from hanging when their thread is cancelled.3. Module wiring and tests
Root POM module set
logger-slf4j,logger-logback,logger-log4j-1andlogger-log4j-2are now active modules again, restoring a full build and test matrix for all bindings.Test updates and refactors
Slf4jChronicleLoggerTest,Slf4jChronicleLoggerPerfTest,Slf4jTestBase) now discover the logger factory via either the SLF4J 2.xChronicleServiceProvideror the classicStaticLoggerBinder, and callreload()through the newChronicleLoggerFactoryControlinterface.org.apache.log4j.LoggerandLeveldirectly, with message formatting via simple string concatenation instead of SLF4J{}templates, aligning the tests with the actual appenders in use.Non-functional changes
1. Agent guidelines, encoding policy, and security checklist
AGENTS.mdrefinementiconv, IDE settings) to enforce it.mvn -q clean verifyfrom a clean checkout, plus a short section on when to open a PR and how to keep changes focused..adocfiles.logger-slf4j-2is the default; legacy SLF4J 1.7.x call-sites should use explicit bridges such asslf4j-reload4j.2. Documentation and requirements catalogue
New and updated docs
CLAUDE.mdandGEMINI.mdadded as per-tool guides explaining:chronicle-core,chronicle-bytes,chronicle-queue).CLG-*tags) and how agents should respect British English + ISO-8859-1.README.adoc::toc:,:lang: en-GB,:source-highlighter: rouge).logger-slf4j-2plus explicit bridges for older code.adoc/project-requirements.adoc,src/main/docs/project-requirements.adoc,functional-requirements.adoc,architecture-overview.adoc,code-review-playbook.adoc,testing-strategy.adocanddecision-log.adoc:CLG-FN-*,CLG-NF-*,CLG-DOC-*,CLG-OPS-*).CLG-FN-006to capture the decision to default to SLF4J 2.x while supporting legacy bridges.3. Test logging and diagnostics
slf4j-nop) for console loggers (slf4j-simpleorlogger-logbacktest-scope) in several modules so that misconfigurations and failures produce visible output.System.errmessages in configuration and property-binding code paths to make failure modes explicit without changing successful behaviour.Overall, this PR makes Chronicle Logger SLF4J-2-friendly by default, keeps SLF4J 1.x and Log4j 1/2 paths working via explicit bridges, and strengthens the documentation, agent guidance and testing around those contracts.