com.cybersource.ws.client
Interface Logger

All Known Implementing Classes:
LoggerImpl, LoggerWrapper

public interface Logger

Interface that may be implemented to supply a different Logger object to the runTransaction() method of the clients. The default Logger object created and used by the clients writes to a file.


Field Summary
static java.lang.String LT_EXCEPTION
           
static java.lang.String LT_FAULT
           
static java.lang.String LT_FILESTART
           
static java.lang.String LT_INFO
           
static java.lang.String LT_MERCHCFG
           
static java.lang.String LT_PROXYCFG
           
static java.lang.String LT_REPLY
           
static java.lang.String LT_REQUEST
           
static java.lang.String LT_TRANSTART
           
 
Method Summary
 void log(java.lang.String type, java.lang.String text)
          This is where the actual logging takes place.
 void logTransactionStart()
          This is where the entry that marks the start of the transaction should be logged.
 void prepare()
          This is where any PER-TRANSACTION preparation should be done.
 

Field Detail

LT_FILESTART

static final java.lang.String LT_FILESTART
See Also:
Constant Field Values

LT_TRANSTART

static final java.lang.String LT_TRANSTART
See Also:
Constant Field Values

LT_MERCHCFG

static final java.lang.String LT_MERCHCFG
See Also:
Constant Field Values

LT_PROXYCFG

static final java.lang.String LT_PROXYCFG
See Also:
Constant Field Values

LT_REQUEST

static final java.lang.String LT_REQUEST
See Also:
Constant Field Values

LT_REPLY

static final java.lang.String LT_REPLY
See Also:
Constant Field Values

LT_FAULT

static final java.lang.String LT_FAULT
See Also:
Constant Field Values

LT_INFO

static final java.lang.String LT_INFO
See Also:
Constant Field Values

LT_EXCEPTION

static final java.lang.String LT_EXCEPTION
See Also:
Constant Field Values
Method Detail

prepare

void prepare()
             throws com.cybersource.ws.client.ConfigException
This is where any PER-TRANSACTION preparation should be done. Any one- time initializations must be done in another method as this method is called at the start of every transaction (unless you pass false to the prepareFile parameter of the runTransaction() method). In the case of the default file-based LoggerImpl, it checks whether the file has reached the maximum size and if so, archives it. It then creates a new file and logs an LT_FILESTART entry. This is also a good place to read and check any configuration parameters that your Logger object may require.

Throws:
ConfigException - if anything fails during preparation.

logTransactionStart

void logTransactionStart()
This is where the entry that marks the start of the transaction should be logged. The default LoggerImpl logs an LT_TRANSTART entry here. No exceptions are thrown so as not to fail transactions due to logging failures.


log

void log(java.lang.String type,
         java.lang.String text)
This is where the actual logging takes place. No exceptions are thrown so as not to fail transactions due to logging failures.

Parameters:
type - the log entry type. A few log types have been predefined.
text - the actual text to be logged.


Copyright © 2017. All Rights Reserved.