org.webbitserver.handler.logging
Class SimpleLogSink

java.lang.Object
  extended by org.webbitserver.handler.logging.SimpleLogSink
All Implemented Interfaces:
LogSink

public class SimpleLogSink
extends Object
implements LogSink


Field Summary
protected  String[] dataValuesToLog
           
protected  String lineSeparator
           
protected  Appendable out
           
protected  boolean trouble
           
 
Constructor Summary
SimpleLogSink(Appendable out, String... dataValuesToLog)
           
SimpleLogSink(String... dataValuesToLog)
           
 
Method Summary
protected  String address(SocketAddress address)
           
 void custom(HttpRequest request, String action, String data)
           
 void error(HttpRequest request, Throwable error)
           
 void eventSourceConnectionClose(EventSourceConnection connection)
           
 void eventSourceConnectionOpen(EventSourceConnection connection)
           
 void eventSourceOutboundData(EventSourceConnection connection, String data)
           
protected  void flush()
           
protected  Appendable formatHeader(Appendable out)
           
protected  Appendable formatLogEntry(Appendable out, HttpRequest request, String action, String data)
           
protected  Appendable formatValue(Appendable out, Object value)
           
 void httpEnd(HttpRequest request)
           
 void httpStart(HttpRequest request)
           
protected  void panic(IOException exception)
           
 void webSocketConnectionClose(WebSocketConnection connection)
           
 void webSocketConnectionOpen(WebSocketConnection connection)
           
 void webSocketInboundData(WebSocketConnection connection, byte[] data)
           
 void webSocketInboundData(WebSocketConnection connection, String data)
           
 void webSocketInboundPing(WebSocketConnection connection, byte[] msg)
           
 void webSocketInboundPong(WebSocketConnection connection, byte[] msg)
           
 void webSocketOutboundData(WebSocketConnection connection, byte[] data)
           
 void webSocketOutboundData(WebSocketConnection connection, String data)
           
 void webSocketOutboundPing(WebSocketConnection connection, byte[] msg)
           
 void webSocketOutboundPong(WebSocketConnection connection, byte[] msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected final Appendable out

dataValuesToLog

protected final String[] dataValuesToLog

lineSeparator

protected final String lineSeparator

trouble

protected boolean trouble
Constructor Detail

SimpleLogSink

public SimpleLogSink(Appendable out,
                     String... dataValuesToLog)

SimpleLogSink

public SimpleLogSink(String... dataValuesToLog)
Method Detail

httpStart

public void httpStart(HttpRequest request)
Specified by:
httpStart in interface LogSink

httpEnd

public void httpEnd(HttpRequest request)
Specified by:
httpEnd in interface LogSink

webSocketConnectionOpen

public void webSocketConnectionOpen(WebSocketConnection connection)
Specified by:
webSocketConnectionOpen in interface LogSink

webSocketConnectionClose

public void webSocketConnectionClose(WebSocketConnection connection)
Specified by:
webSocketConnectionClose in interface LogSink

webSocketInboundData

public void webSocketInboundData(WebSocketConnection connection,
                                 String data)
Specified by:
webSocketInboundData in interface LogSink

webSocketInboundData

public void webSocketInboundData(WebSocketConnection connection,
                                 byte[] data)
Specified by:
webSocketInboundData in interface LogSink

webSocketInboundPing

public void webSocketInboundPing(WebSocketConnection connection,
                                 byte[] msg)
Specified by:
webSocketInboundPing in interface LogSink

webSocketInboundPong

public void webSocketInboundPong(WebSocketConnection connection,
                                 byte[] msg)
Specified by:
webSocketInboundPong in interface LogSink

webSocketOutboundData

public void webSocketOutboundData(WebSocketConnection connection,
                                  String data)
Specified by:
webSocketOutboundData in interface LogSink

webSocketOutboundData

public void webSocketOutboundData(WebSocketConnection connection,
                                  byte[] data)
Specified by:
webSocketOutboundData in interface LogSink

webSocketOutboundPing

public void webSocketOutboundPing(WebSocketConnection connection,
                                  byte[] msg)
Specified by:
webSocketOutboundPing in interface LogSink

webSocketOutboundPong

public void webSocketOutboundPong(WebSocketConnection connection,
                                  byte[] msg)
Specified by:
webSocketOutboundPong in interface LogSink

error

public void error(HttpRequest request,
                  Throwable error)
Specified by:
error in interface LogSink

custom

public void custom(HttpRequest request,
                   String action,
                   String data)
Specified by:
custom in interface LogSink

eventSourceConnectionOpen

public void eventSourceConnectionOpen(EventSourceConnection connection)
Specified by:
eventSourceConnectionOpen in interface LogSink

eventSourceConnectionClose

public void eventSourceConnectionClose(EventSourceConnection connection)
Specified by:
eventSourceConnectionClose in interface LogSink

eventSourceOutboundData

public void eventSourceOutboundData(EventSourceConnection connection,
                                    String data)
Specified by:
eventSourceOutboundData in interface LogSink

flush

protected void flush()
              throws IOException
Throws:
IOException

panic

protected void panic(IOException exception)

formatLogEntry

protected Appendable formatLogEntry(Appendable out,
                                    HttpRequest request,
                                    String action,
                                    String data)
                             throws IOException
Throws:
IOException

formatHeader

protected Appendable formatHeader(Appendable out)
                           throws IOException
Throws:
IOException

formatValue

protected Appendable formatValue(Appendable out,
                                 Object value)
                          throws IOException
Throws:
IOException

address

protected String address(SocketAddress address)


Copyright © 2012. All Rights Reserved.