© 2002 - Lorne Brinkman
www.TheObjectGuy.com
Lorne@TheObjectGuy.com

com.bitfactoryinc.logging
Class SimpleSocketLogger

java.lang.Object
  |
  +--com.bitfactoryinc.logging.Logger
        |
        +--com.bitfactoryinc.logging.SimpleSocketLogger

public class SimpleSocketLogger
extends Logger

Instances of this class write out LogEntry information as a String to a Socket.

See Also:
SerialSocketLogger

Field Summary
private  java.net.InetAddress inetAddress
           
private  int port
           
private  java.net.Socket socket
           
 
Fields inherited from class com.bitfactoryinc.logging.Logger
application, defaultFilterClass, defaultFormatterClass, enabled, filter, formatter
 
Constructor Summary
private SimpleSocketLogger()
           
  SimpleSocketLogger(java.net.InetAddress anInetAddress, int aPort)
           
  SimpleSocketLogger(java.net.Socket aSocket)
           
  SimpleSocketLogger(java.lang.String aHostName, int aPort)
           
 
Method Summary
protected  boolean doLog(LogEntry aLogEntry)
          We're past filtering at this point.
protected  void finalize()
           
private  java.net.InetAddress getInetAddress()
           
private  int getPort()
           
private  java.net.Socket getSocket()
           
protected  boolean handleLogFailure(LogEntry aLogEntry)
           
protected  void resetSocket()
           
private  void setInetAddress(java.net.InetAddress newInetAddress)
           
private  void setPort(int newPort)
           
private  void setSocket(java.net.Socket newSocket)
           
private  void tryToWriteToLog(java.lang.String s)
           
protected  boolean writeToLog(LogEntry aLogEntry, java.lang.String s)
           
 
Methods inherited from class com.bitfactoryinc.logging.Logger
getApplication, getDefaultFilterClass, getDefaultFormatterClass, getFilter, getFormatter, getSeverityThreshold, isEnabled, log, log, log, logCritical, logCritical, logDebug, logDebug, logError, logError, logFatal, logFatal, logInfo, logInfo, logStatus, logStatus, logWarning, logWarning, setApplication, setDefaultFilter, setDefaultFilterClass, setDefaultFormatter, setDefaultFormatterClass, setEnabled, setFilter, setFormatter, setSeverityThreshold, shouldLog, writeToLog
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

socket

private java.net.Socket socket

inetAddress

private java.net.InetAddress inetAddress

port

private int port
Constructor Detail

SimpleSocketLogger

private SimpleSocketLogger()

SimpleSocketLogger

public SimpleSocketLogger(java.lang.String aHostName,
                          int aPort)

SimpleSocketLogger

public SimpleSocketLogger(java.net.InetAddress anInetAddress,
                          int aPort)

SimpleSocketLogger

public SimpleSocketLogger(java.net.Socket aSocket)
Method Detail

doLog

protected boolean doLog(LogEntry aLogEntry)
Description copied from class: Logger
We're past filtering at this point. Now it's time to really log aLogEntry. Subclasses might want to do something more interesting and override this method.
Overrides:
doLog in class Logger

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object

getInetAddress

private java.net.InetAddress getInetAddress()

getPort

private int getPort()

getSocket

private java.net.Socket getSocket()

handleLogFailure

protected boolean handleLogFailure(LogEntry aLogEntry)

resetSocket

protected void resetSocket()
                    throws java.io.IOException

setInetAddress

private void setInetAddress(java.net.InetAddress newInetAddress)

setPort

private void setPort(int newPort)

setSocket

private void setSocket(java.net.Socket newSocket)

tryToWriteToLog

private void tryToWriteToLog(java.lang.String s)
                      throws java.io.IOException

writeToLog

protected boolean writeToLog(LogEntry aLogEntry,
                             java.lang.String s)

© 2002 - Lorne Brinkman
www.TheObjectGuy.com
Lorne@TheObjectGuy.com