php.java.bridge
Class ChainsawLogger

java.lang.Object
  extended by php.java.bridge.SimpleLog4jLogger
      extended by php.java.bridge.ChainsawLogger
All Implemented Interfaces:
ILogger

public class ChainsawLogger
extends SimpleLog4jLogger
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
 
Fields inherited from interface php.java.bridge.ILogger
DEBUG, ERROR, FATAL, INFO
 
Method Summary
 void configure(java.lang.String defaultHost, int configuredPort)
          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.SimpleLog4jLogger
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 configuredPort)
               throws java.lang.Exception
override this method, if you want to connect to a different host or port

Parameters:
defaultHost - The default host
configuredPort - The default port
Throws:
java.lang.Exception - If chainsaw isn't running.

createChainsawLogger

public static ChainsawLogger createChainsawLogger()
                                           throws java.lang.Exception
Create a new chainsaw logger.

Returns:
The chainsaw logger
Throws:
java.lang.Exception - If chainsaw isn't running.
See Also:
Util.setDefaultLogger(ILogger)

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object