1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package ch.qos.logback.classic.net;
16
17 import ch.qos.logback.classic.spi.ILoggingEvent;
18 import ch.qos.logback.core.net.AbstractSocketAppender;
19 import ch.qos.logback.core.spi.PreSerializationTransformer;
20
21
22
23
24
25
26
27
28
29
30
31
32 public class SocketAppender extends AbstractSocketAppender<ILoggingEvent> {
33
34 private static final PreSerializationTransformer<ILoggingEvent> pst = new LoggingEventPreSerializationTransformer();
35
36 private boolean includeCallerData = false;
37
38 public SocketAppender() {
39 }
40
41 @Override
42 protected void postProcessEvent(ILoggingEvent event) {
43 if (includeCallerData) {
44 event.getCallerData();
45 }
46 }
47
48 public void setIncludeCallerData(boolean includeCallerData) {
49 this.includeCallerData = includeCallerData;
50 }
51
52 public PreSerializationTransformer<ILoggingEvent> getPST() {
53 return pst;
54 }
55
56 }