com.endeca.logging
Class LogConnection

java.lang.Object
  extended by com.endeca.logging.LogConnection

public class LogConnection
extends Object

This class is used to create an HTTP connection to the Log Server, where LogEntry objects can be sent and recorded. The LogConnection contains the hostname and port of the Log Server.


Constructor Summary
LogConnection(String host, int port)
          Creates a new instance of LogConnection
LogConnection(String host, String port)
          Creates a new instance of LogConnection
 
Method Summary
 void log(LogEntry entry)
          Sends a log request to the Log Server without waiting for a response.
 boolean logAndWait(LogEntry entry)
          Sends a log request to the Log Server and reads the response.
 void logAsynchronously(LogEntry entry)
          Queues up a log request to send to the Log Server asynchronously and without waiting for a response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogConnection

public LogConnection(String host,
                     int port)
Creates a new instance of LogConnection


LogConnection

public LogConnection(String host,
                     String port)
Creates a new instance of LogConnection

Method Detail

log

public void log(LogEntry entry)
         throws LogException
Sends a log request to the Log Server without waiting for a response. Using this method instead of LogAndWait() can improve performance, because the extra step of insuring the Log Server reeived the request is not performed.

Throws:
LogException

logAsynchronously

public void logAsynchronously(LogEntry entry)
                       throws LogException
Queues up a log request to send to the Log Server asynchronously and without waiting for a response. Using this method instead of log() or LogAndWait() can improve performance by preventing the Logging API from holding onto the thread while sending the log entry.

Throws:
LogException

logAndWait

public boolean logAndWait(LogEntry entry)
                   throws LogException
Sends a log request to the Log Server and reads the response.

Returns:
true if the Log Server successfully logged the entry.
Throws:
LogException


© 2011 Endeca Technologies, Inc.
Endeca Confidential