Skip to content

Commit

Permalink
Polish "Logback StructuredLogFormatter exceptions are not visible to …
Browse files Browse the repository at this point in the history
…the user"

See gh-43575
  • Loading branch information
mhalbritter committed Jan 13, 2025
1 parent c256f41 commit 33849f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* @author Dmytro Nosan
*/
final class FilteringStatusListener extends ContextAwareBase implements StatusListener, LifeCycle {
class FilteringStatusListener extends ContextAwareBase implements StatusListener, LifeCycle {

private final StatusListener delegate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,10 @@ private void addOnErrorConsoleStatusListener(LoggerContext context) {
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) {
Expand Down

0 comments on commit 33849f8

Please sign in to comment.