Polish "Logback StructuredLogFormatter exceptions are not visible to the user"

See gh-43575
This commit is contained in:
Moritz Halbritter 2025-01-13 11:34:10 +01:00
parent c256f41fce
commit 33849f82b4
2 changed files with 5 additions and 3 deletions

View File

@ -27,7 +27,7 @@ import ch.qos.logback.core.status.StatusListener;
*
* @author Dmytro Nosan
*/
final class FilteringStatusListener extends ContextAwareBase implements StatusListener, LifeCycle {
class FilteringStatusListener extends ContextAwareBase implements StatusListener, LifeCycle {
private final StatusListener delegate;

View File

@ -495,8 +495,10 @@ public class LogbackLoggingSystem extends AbstractLoggingSystem implements BeanF
FilteringStatusListener listener = new FilteringStatusListener(new OnErrorConsoleStatusListener(),
Status.ERROR);
listener.setContext(context);
context.getStatusManager().add(listener);
listener.start();
boolean effectivelyAdded = context.getStatusManager().add(listener);
if (effectivelyAdded) {
listener.start();
}
}
void setStatusPrinterStream(PrintStream stream) {