View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.classic.net.server;
15  
16  import ch.qos.logback.classic.net.LoggingEventPreSerializationTransformer;
17  import ch.qos.logback.classic.spi.ILoggingEvent;
18  import ch.qos.logback.core.net.server.SSLServerSocketAppenderBase;
19  import ch.qos.logback.core.spi.PreSerializationTransformer;
20  
21  /**
22   * A {@link ServerSocketAppender} that supports SSL.
23   *
24   * @author Carl Harris
25   */
26  public class SSLServerSocketAppender extends SSLServerSocketAppenderBase<ILoggingEvent> {
27  
28      private static final PreSerializationTransformer<ILoggingEvent> pst = new LoggingEventPreSerializationTransformer();
29  
30      private boolean includeCallerData;
31  
32      @Override
33      protected void postProcessEvent(ILoggingEvent event) {
34          if (isIncludeCallerData()) {
35              event.getCallerData();
36          }
37      }
38  
39      @Override
40      protected PreSerializationTransformer<ILoggingEvent> getPST() {
41          return pst;
42      }
43  
44      public boolean isIncludeCallerData() {
45          return includeCallerData;
46      }
47  
48      public void setIncludeCallerData(boolean includeCallerData) {
49          this.includeCallerData = includeCallerData;
50      }
51  
52  }