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  // Contributors: Dan MacDonald <dan@redknee.com>
15  package ch.qos.logback.access.net;
16  
17  import ch.qos.logback.access.spi.IAccessEvent;
18  import ch.qos.logback.core.net.AbstractSocketAppender;
19  import ch.qos.logback.core.spi.PreSerializationTransformer;
20  
21  /**
22   * Sends {@link IAccessEvent} objects to a remote a log server, usually a
23   * {@link SocketNode}.
24   * 
25   * For more information about this appender, please refer to the online manual at
26   * http://logback.qos.ch/manual/appenders.html#AccessSocketAppender
27   *  
28   * @author Ceki G&uuml;lc&uuml;
29   * @author S&eacute;bastien Pennec
30   * 
31   */
32  
33  public class SocketAppender extends AbstractSocketAppender<IAccessEvent> {
34  
35      PreSerializationTransformer<IAccessEvent> pst = new AccessEventPreSerializationTransformer();
36  
37      public SocketAppender() {
38      }
39  
40      @Override
41      protected void postProcessEvent(IAccessEvent event) {
42          event.prepareForDeferredProcessing();
43      }
44  
45      public PreSerializationTransformer<IAccessEvent> getPST() {
46          return pst;
47      }
48  }