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 * @author Dmytro Nosan
*/ */
final class FilteringStatusListener extends ContextAwareBase implements StatusListener, LifeCycle { class FilteringStatusListener extends ContextAwareBase implements StatusListener, LifeCycle {
private final StatusListener delegate; private final StatusListener delegate;

View File

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