Skip to content

Fix critical bugs, JDK 8-25 compatibility, add tests and new features - #1

Merged
sirelves merged 1 commit into
masterfrom
feature/jdk-compat-bugfixes-tests
Mar 5, 2026
Merged

Fix critical bugs, JDK 8-25 compatibility, add tests and new features#1
sirelves merged 1 commit into
masterfrom
feature/jdk-compat-bugfixes-tests

Conversation

@sirelves

@sirelves sirelves commented Mar 5, 2026

Copy link
Copy Markdown
Owner

Bug fixes:

  • Fix duplicate condition in RollingFileSink.alignCurrentFileTo
  • Fix BooleanScalarConversionPolicy not setting result.result
  • Fix inverted TemporalAccessor format condition in ScalarValue
  • Fix LogEventProperty.isValidName accepting invalid names
  • Fix typo remotePropertyIfPresent -> removePropertyIfPresent
  • Fix invalid format strings in PropertyBinder (%1, {0} -> %s)
  • Implement file size limit check in FileSink

JDK compatibility:

  • Wrap setAccessible in try-catch for JDK 16+ in Reflection
  • Replace new Integer(c) with (int) c in JsonFormatter
  • Use StandardCharsets.UTF_8 in SeqSink
  • Update Maven Compiler Plugin to 3.13.0

Resource leaks and thread safety:

  • Fix SeqSink: try-with-resources, disconnect, StringBuilder
  • Set output=null on FileSink.close
  • Replace HashMap+synchronized with ConcurrentHashMap in MessageTemplateCache
  • Add volatile to Log._logger
  • Use ConcurrentHashMap+computeIfAbsent in EnumScalarConversionPolicy
  • ThreadLocal for SimpleDateFormat in JsonFormatter

New features:

  • Enrichers: ThreadId, ThreadName, MachineName, ProcessId
  • ConsoleSink (plain, no ANSI) with configurator
  • AsyncWrapperSink with BlockingQueue and daemon thread
  • Minimum level override by source context
  • PropertiesFileConfiguration and SinkRegistry

Testing:

  • Add JUnit 5 and Surefire Plugin
  • Add InMemorySink for testing
  • Add 50 tests across 9 test classes
  • Add CI workflow for JDK 8/11/17/21/25 matrix

Tested locally on JDK 8, 17, and 25 - all 50 tests pass.

Bug fixes:
- Fix duplicate condition in RollingFileSink.alignCurrentFileTo
- Fix BooleanScalarConversionPolicy not setting result.result
- Fix inverted TemporalAccessor format condition in ScalarValue
- Fix LogEventProperty.isValidName accepting invalid names
- Fix typo remotePropertyIfPresent -> removePropertyIfPresent
- Fix invalid format strings in PropertyBinder (%1, {0} -> %s)
- Implement file size limit check in FileSink

JDK compatibility:
- Wrap setAccessible in try-catch for JDK 16+ in Reflection
- Replace new Integer(c) with (int) c in JsonFormatter
- Use StandardCharsets.UTF_8 in SeqSink
- Update Maven Compiler Plugin to 3.13.0

Resource leaks and thread safety:
- Fix SeqSink: try-with-resources, disconnect, StringBuilder
- Set output=null on FileSink.close
- Replace HashMap+synchronized with ConcurrentHashMap in MessageTemplateCache
- Add volatile to Log._logger
- Use ConcurrentHashMap+computeIfAbsent in EnumScalarConversionPolicy
- ThreadLocal for SimpleDateFormat in JsonFormatter

New features:
- Enrichers: ThreadId, ThreadName, MachineName, ProcessId
- ConsoleSink (plain, no ANSI) with configurator
- AsyncWrapperSink with BlockingQueue and daemon thread
- Minimum level override by source context
- PropertiesFileConfiguration and SinkRegistry

Testing:
- Add JUnit 5 and Surefire Plugin
- Add InMemorySink for testing
- Add 50 tests across 9 test classes
- Add CI workflow for JDK 8/11/17/21/25 matrix

Tested locally on JDK 8, 17, and 25 - all 50 tests pass.
@sirelves
sirelves merged commit 9cc4496 into master Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant