com.ibm.websphere.als
Class HttpLogger

java.lang.Object
  |
  +--com.ibm.websphere.als.HttpLogger
All Implemented Interfaces:
Logger

public class HttpLogger
extends java.lang.Object
implements Logger

This class implements Logger interface for HTTP/S persistence. The records are POSTED to the specified URL which must be a web program such as CGI or servlet. This class doesn't support security of any form; thus the URL should not be in a protected realm. The data is format as a 5-tuple as follow:

sawt_site=siteName&sawt_type=WT_WAS{&sawt_info=data}+ where data is

See DatabaseLogger class for definition of the fields. If a field is null, a dash (-) will be written in that position. For example, "sawt_site=yahoo&sawt_type=WT_WAS&sawt_info=<01010123-1234> <-><->&sawt_info=<01010123-1235> <-><->"

See Also:
DatabaseLogger

Constructor Summary
HttpLogger(java.net.URL url)
          Constructs a HTTP-base Logger.
HttpLogger(java.net.URL url, java.lang.String siteName)
          Constructs a HTTP-base Logger.
 
Method Summary
 java.lang.Object getStorageSource()
          Returns my storage source -- a URL
 void write(LogRecord[] lr)
          Sends the data to the receiving URL specified in the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpLogger

public HttpLogger(java.net.URL url)
Constructs a HTTP-base Logger. The name of the site is default to the hostname of the specified URL.
Parameters:
url - a web program URL receiving the data from this logger such as a CGI or a servlet

HttpLogger

public HttpLogger(java.net.URL url,
                  java.lang.String siteName)
Constructs a HTTP-base Logger.
Parameters:
url - a web program URL receiving the data from this logger such as a CGI or a servlet
siteName - a name representing the site where the data generated
Method Detail

write

public void write(LogRecord[] lr)
           throws java.lang.Exception
Sends the data to the receiving URL specified in the constructor.
Specified by:
write in interface Logger
Parameters:
lr - array of LogRecords
Throws:
java.lang.Exception - when unable to send data to the URL after 3 tries.

getStorageSource

public java.lang.Object getStorageSource()
Returns my storage source -- a URL
Specified by:
getStorageSource in interface Logger