Skip to content

Extract constant and unify messages in Log4JCoreLoggerContextCondition #45967

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

Closed

Conversation

wonyongg
Copy link
Contributor

This PR improves the readability and consistency of Log4JCoreLoggerContextCondition by:

  • Extracting the fully qualified class name "org.apache.logging.log4j.core.LoggerContext" into a constant named LOGGER_CONTEXT_CLASS_NAME
  • Using the constant in both the runtime type check (Class.forName(...)) and the ConditionOutcome.match() / noMatch() messages
  • Unifying the wording of outcome messages by replacing "Logger context" with "LoggerContext", to match the class name and reduce ambiguity

These small improvements help reduce duplication and improve maintainability without changing any functional logic.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 14, 2025
- Moved the repeated string "org.apache.logging.log4j.core.LoggerContext" to a private static final constant
- Used the constant in Class.forName() and ConditionOutcome messages
- Unified inconsistent messages: changed "Logger context" to "LoggerContext" for consistency with the class name

Signed-off-by: wonyongg <[email protected]>
@wonyongg wonyongg force-pushed the loggercontext-constant branch from cfcdac9 to ddb9979 Compare June 14, 2025 19:29
@mhalbritter mhalbritter added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 16, 2025
@mhalbritter mhalbritter added this to the 3.3.x milestone Jun 16, 2025
@mhalbritter mhalbritter changed the title Extract LOGGER_CONTEXT_CLASS_NAME constant and unify messages in Log4JCoreLoggerContextCondition Extract constant and unify messages in Log4JCoreLoggerContextCondition Jun 16, 2025
@snicoll snicoll modified the milestones: 3.3.x, 3.4.x Jun 16, 2025
@snicoll snicoll self-assigned this Jun 17, 2025
@snicoll snicoll modified the milestones: 3.4.x, 3.4.7 Jun 17, 2025
snicoll pushed a commit that referenced this pull request Jun 17, 2025
snicoll added a commit that referenced this pull request Jun 17, 2025
@snicoll snicoll closed this in 8deffd2 Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants