33
33
import co .elastic .logging .JsonUtils ;
34
34
import org .slf4j .Marker ;
35
35
36
+ import java .io .IOException ;
37
+ import java .io .OutputStream ;
36
38
import java .nio .charset .Charset ;
37
39
import java .util .ArrayList ;
38
40
import java .util .Iterator ;
@@ -48,6 +50,7 @@ public class EcsEncoder extends EncoderBase<ILoggingEvent> {
48
50
private ThrowableProxyConverter throwableProxyConverter ;
49
51
private boolean includeOrigin ;
50
52
private final List <Pair > additionalFields = new ArrayList <Pair >();
53
+ private OutputStream os ;
51
54
52
55
@ Override
53
56
public byte [] headerBytes () {
@@ -61,6 +64,28 @@ public void start() {
61
64
throwableProxyConverter .start ();
62
65
eventDataset = EcsJsonSerializer .computeEventDataset (eventDataset , serviceName );
63
66
}
67
+ /**
68
+ * This method has been removed in logback 1.2.
69
+ * To make this lib backwards compatible with logback 1.1 we have implement this method.
70
+ */
71
+ public void init (OutputStream os ) {
72
+ this .os = os ;
73
+ }
74
+
75
+ /**
76
+ * This method has been removed in logback 1.2.
77
+ * To make this lib backwards compatible with logback 1.1 we have implement this method.
78
+ */
79
+ public void doEncode (ILoggingEvent event ) throws IOException {
80
+ os .write (encode (event ));
81
+ }
82
+
83
+ /**
84
+ * This method has been removed in logback 1.2.
85
+ * To make this lib backwards compatible with logback 1.1 we have implement this method.
86
+ */
87
+ public void close () throws IOException {
88
+ }
64
89
65
90
@ Override
66
91
public byte [] encode (ILoggingEvent event ) {
0 commit comments