SocketOutputTarget (LogKit API)
Keywords: org.apache.log.output.net.SocketOutputTarget,SocketOutputTarget class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.log.output.net
Class SocketOutputTarget

    java.lang.Object
      |
      +--org.apache.log.output.AbstractTarget
            |
            +--org.apache.log.output.AbstractOutputTarget
                  |
                  +--org.apache.log.output.net.SocketOutputTarget

All Implemented Interfaces:
  ErrorAware, LogTarget

public class SocketOutputTarget
extends AbstractOutputTarget

SocketOutputTarget Useful for writing the output to a TCP/IP client socket.

Author:
  Rajendra Ghorpade

Field Summary

Fields inherited from class org.apache.log.output.AbstractOutputTarget
`m_formatter`

Constructor Summary
`SocketOutputTarget(InetAddress address, int port)` Creates output target with the end point specified by the address and port
`SocketOutputTarget(String host, int port)` Creates the output target with the end point specified by host and port

Method Summary
`void` | `close()` Shutdown target.
`protected void` | `doProcessEvent(LogEvent event)` To process the LogEvent
`protected void` | `write(LogEvent event)` Writes the output as a LogEvent without formatting.

Methods inherited from class org.apache.log.output.AbstractOutputTarget
`getFormatter, open, output, setFormatter, write`

Methods inherited from class org.apache.log.output.AbstractTarget
`error, getErrorHandler, isOpen, processEvent, setErrorHandler`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SocketOutputTarget

    public SocketOutputTarget(InetAddress address,
                              int port)
                       throws IOException

  Creates output target with the end point specified by the address and port

Parameters:
  `address` - end point address
  `port` - the end point port
Throws:
  `IOException` - if an I/O error ocurrs when creating socket

### SocketOutputTarget

    public SocketOutputTarget(String host,
                              int port)
                       throws IOException

  Creates the output target with the end point specified by host and port

Parameters:
  `host` - end point host
  `port` - the end point port
Throws:
  `IOException` - if an I/O error ocurrs when creating socket

Method Detail

### write

    protected void write(LogEvent event)

  Writes the output as a LogEvent without formatting. Formatting ia applied on the server side where it is log.

  Parameters:
    `event` - the LogEvent

### doProcessEvent

    protected void doProcessEvent(LogEvent event)

  To process the LogEvent

  Overrides:
    `doProcessEvent` in class `AbstractOutputTarget`
  Parameters:
    `event` - the LogEvent

### close

    public void close()

  Shutdown target. Attempting to write to target after close() will cause errors to be logged.

  Overrides:
    `close` in class `AbstractOutputTarget`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Jakarta Project. All Rights Reserved.