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

## php.java.bridge
Class ChainsawLogger

    java.lang.Object
      php.java.bridge.Log4jLogger
          php.java.bridge.ChainsawLogger

All Implemented Interfaces:
  ILogger

    public class ChainsawLogger

extends Log4jLogger
implements ILogger

A logger class which connects to chainsaw -- chainsaw is a log4j viewer. Requires that log4j.jar is in the classpath. Start chainsaw, for example by clicking on Applications -> Programming -> Chainsaw or via:

> `java -classpath /usr/share/java/log4j.jar org.apache.log4j.chainsaw.Main`

and then start the PHP/Java Bridge:

> `java -classpath /usr/share/java/log4j.jar:/usr/share/java/JavaBridge.jar php.java.bridge.JavaBridge`

or set the PHP .ini option

> `java.log_file=@127.0.0.1:4445`

.

Field Summary
`static java.lang.String` | `DEFAULT_HOST` The default cainsaw host
`static int` | `DEFAULT_PORT` The default chainsaw port
`static java.lang.String` | `DEFAULT_PORT_NAME` The default chainsaw port

Method Summary
`void` | `configure(java.lang.String defaultHost, int defaultPort)` override this method, if you want to connect to a different host or port
`static ChainsawLogger` | `createChainsawLogger()` Create a new chainsaw logger.
`java.lang.String` | `toString()`

Methods inherited from class php.java.bridge.Log4jLogger
`createLog4jLogger, log, printStackTrace, warn`

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

Methods inherited from interface php.java.bridge.ILogger
`log, printStackTrace, warn`

Field Detail

### DEFAULT_PORT

    public static final int DEFAULT_PORT

  The default chainsaw port

  See Also:
    Constant Field Values

### DEFAULT_PORT_NAME

    public static final java.lang.String DEFAULT_PORT_NAME

  The default chainsaw port

### DEFAULT_HOST

    public static final java.lang.String DEFAULT_HOST

  The default cainsaw host

  See Also:
    Constant Field Values

Method Detail

### configure

    public void configure(java.lang.String defaultHost,
                          int defaultPort)
                   throws java.lang.Exception

  override this method, if you want to connect to a different host or port

  Parameters:
    `defaultHost` - The default host
    `defaultPort` - The default port
  Throws:
    `UnknownHostException` - Cannot happen.
    `IOException` - If chainsaw isn't running.
    `java.lang.Exception`

### createChainsawLogger

    public static ChainsawLogger createChainsawLogger()
                                               throws java.lang.Exception

  Create a new chainsaw logger.

  Throws:
    `UnknownHostException` - If the host does not exist.
    `IOException` - If chainsaw isn't running.
    `java.lang.Exception`
  See Also:
    `Util.setLogger(ILogger)`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

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