Dev#4
Conversation
Replace List.of() and Set.of() with static imports of Collections.emptyList() and emptySet() in ThrowableLogging test. Also remove an extraneous blank line in setLoggerLevel(). These changes clarify intent and can improve compatibility with older Java versions.
Relocate the JUnit BOM and junit dependency to the top of the dependencyManagement section and remove their duplicate entries later in the file. Uses ${junit-jupiter.version} for the BOM and ${junit.version} for junit; this cleans up the POM organization and avoids duplicated dependency declarations.
Reorder and clean up the modules table in the README: simplify wording for the core and test modules, clarify the parent and dependencies entries, and add a new microsphere-logging-logback module for Logback extensions. Also adjust table formatting for clearer presentation.
Introduce a new microsphere-logging-log4j2 module to provide a Log4j2-backed implementation of the Logging SPI. Adds module POM, main implementation (Log4j2Logging), utility class (LoggerUtils), service registration, Log4j2 test config, and unit tests. Also updates the aggregator pom.xml to include the new module and adds the new artifact to microsphere-logging-dependencies/pom.xml.
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
🤖 Augment PR SummarySummary: Adds Log4j2 support to Microsphere Logging and wires it into the multi-module build. Changes:
Technical Notes: Log4j2 dependencies are declared as optional so consuming apps need to provide Log4j2 on their runtime classpath. 🤖 Was this summary useful? React with 👍 or 👎 |
| microsphere-logging-parent | Parent POM with shared configurations. | ||
| microsphere-logging-dependencies | Manages dependency versions across the project. | ||
| microsphere-logging-core | Provides the core features for logging. | ||
| microsphere-logging-logback | Provides the extensions features for logback. |
| <version>${revision}</version> | ||
| <packaging>jar</packaging> | ||
|
|
||
| <name>Microsphere :: Logging :: Logj4</name> |
| * @see Log4j2Logging | ||
| * @since 1.0.0 | ||
| */ | ||
| class Log4j2LoggingTest { |
There was a problem hiding this comment.
This module contains src/test/resources/META-INF/services/io.microsphere.logging.Logging listing io.microsphere.logging.ThrowableLogging, but that class lives under microsphere-logging-core test sources and won’t be on this module’s test/runtime classpath. If any test calls LoggingUtils.loadAll(), this would fail with a ServiceConfigurationError.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
This pull request introduces a new Log4j2 integration module to the Microsphere logging framework, providing Log4j2 support alongside improvements to documentation, dependency management, and code quality. The most significant changes are the addition of the
microsphere-logging-log4j2module, its supporting utilities and tests, and updates to project configuration files to incorporate this new module.Log4j2 Integration:
microsphere-logging-log4j2with its ownpom.xml, implementing theLogginginterface for Log4j2 via the newLog4j2Loggingclass. This includes core functionality to get/set logger levels, retrieve logger names, and determine parent loggers. [1] [2]LoggerUtilsutility class in the new module to encapsulate Log4j2-specific logger operations, such as retrieving logger contexts, levels, and setting logger levels.Log4j2Loggingimplementation as a service provider for theLogginginterface.Testing and Configuration:
Log4j2LoggingandLoggerUtilsto ensure correct behavior of logger operations and integration with Log4j2. [1] [2]log4j2.xml) for testing, specifying logger levels and appenders.Build and Dependency Management:
microsphere-logging-dependencies/pom.xmlto include the newmicrosphere-logging-log4j2module as a managed dependency.microsphere-logging-parent/pom.xmlto add JUnit BOM and JUnit dependencies for consistent test management across modules.Documentation:
README.mdto list and describe the new Log4j2 module and clarify the purpose of existing modules.Code Quality:
microsphere-logging-coreto useemptyList()andemptySet()for clarity and consistency. [1] [2] [3]