com.basistech.rlp
Class RLPLog4jCallback

java.lang.Object
  extended by com.basistech.rlp.RLPLog4jCallback
All Implemented Interfaces:
RLPEnvironment.LogCallback

public class RLPLog4jCallback
extends Object
implements RLPEnvironment.LogCallback

This class implements RLP's LogCallback using a log4j logger.


Constructor Summary
RLPLog4jCallback(org.apache.log4j.Logger logger)
          Pass a log4j Logger object for your application to this constructor.
 
Method Summary
 void message(int channel, String message)
          Receives each log message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RLPLog4jCallback

public RLPLog4jCallback(org.apache.log4j.Logger logger)
Pass a log4j Logger object for your application to this constructor. Below is a typical use:
  static Logger logger = Logger.getLogger(MyApp.class);
  BasicConfigurator.configure();
  LogCallback rlpLogCB = new RLPLog4jCallback(logger);
  RLPEnvironmentParameters rlpenvp = new RLPEnvironmentParameters();
  rlpenvp.setLogCallback(rlpLogCb);
  rlpenvp.setLogLevel("all"); // Let log4j decide the log level.
 

NOTE: log4j JAR file must be in your class path if you use this class. This class has been tested with version 1.2.13 of log4j.

Parameters:
logger - A log4j logger.
Method Detail

message

public void message(int channel,
                    String message)
Receives each log message.

Specified by:
message in interface RLPEnvironment.LogCallback
Parameters:
channel - The originating channel of the message, Logging Channels.
message - The message text. Note that a logical message may be split into multiple. calls to this function. If you need to organize the results into a GUI, look for newlines.


Copyright © 2004-2008 Basis Technology Corporation. All Rights Reserved.