Skip to content

Conversation

@JohannesRiegler
Copy link
Contributor

My previous "fix" in #146 actually breaks application startup if used in a kubernetes Context.

During startup the loggerContext is not yet initialised and the (LoggerContext) LoggerFactory.getILoggerFactory() call returns a SubstituteLoggerFactory which breaks when trying to cast to a LoggerContext.

I tried to replicate the Environment in a test but i could not find a good solution even with junit-pioneer or system-stubs


public LengthSplittingAppender() {
super();
LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this call will run before the logger context is initialised and will case a startup failure

@rspiegl rspiegl merged commit 7ac8758 into cloudflightio:master Jun 18, 2025
1 check passed
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.

2 participants