1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package ch.qos.logback.classic.util;
16
17 import java.io.IOException;
18
19 import ch.qos.logback.classic.issue.logback1159.LoggingError;
20 import ch.qos.logback.core.spi.ContextAwareBase;
21 import ch.qos.logback.core.spi.LifeCycle;
22 import ch.qos.logback.core.status.Status;
23 import ch.qos.logback.core.status.StatusListener;
24 import ch.qos.logback.core.status.ErrorStatus;
25
26
27
28
29
30 public class LogbackListener1159 extends ContextAwareBase implements StatusListener, LifeCycle {
31 private boolean started;
32
33 @Override
34 public void start() {
35 this.started = true;
36 }
37
38 @Override
39 public void stop() {
40 this.started = false;
41 }
42
43 @Override
44 public boolean isStarted() {
45 return this.started;
46 }
47
48 @Override
49 public void addStatusEvent(final Status status) {
50 if (status instanceof ErrorStatus && status.getThrowable() instanceof IOException) {
51 System.out.println("*************************LogbackListener.addStatusEvent");
52 throw new LoggingError(status.getMessage(), status.getThrowable());
53 }
54 }
55
56 }