|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.props.Props
com.cometway.ak.Agent
com.cometway.ak.ServiceAgent
com.cometway.io.FileLoggerAgent
com.cometway.io.FileReporter
public class FileReporter
This is a Reporter Agent that extends FileLoggerAgent in order to log Agent Kernel agent output to sequentially named text files. Upon loading, this agent replaces the default Reporter.
| Field Summary | |
|---|---|
protected static java.lang.String |
DEBUG_AFTER
|
protected static java.lang.String |
DEBUG_BEFORE
|
protected ReporterInterface |
defaultReporter
|
protected boolean |
echo_debug
|
protected boolean |
echo_error
|
protected boolean |
echo_println
|
protected boolean |
echo_warning
|
protected static java.lang.String |
ERROR_AFTER
|
protected static java.lang.String |
ERROR_BEFORE
|
protected boolean |
log_debug
|
protected boolean |
log_error
|
protected boolean |
log_println
|
protected boolean |
log_warning
|
protected static java.lang.String |
PRINTLN_AFTER
|
protected static java.lang.String |
PRINTLN_BEFORE
|
protected static java.text.SimpleDateFormat |
SDF
|
protected java.lang.Object |
synchObject
|
protected static java.lang.String |
WARNING_AFTER
|
protected static java.lang.String |
WARNING_BEFORE
|
| Fields inherited from class com.cometway.io.FileLoggerAgent |
|---|
EOL, logCount, logSync, out |
| Fields inherited from class com.cometway.ak.Agent |
|---|
agent_id, agentController, CREATING_STATE, debugReporter, DESTROYED_STATE, DESTROYING_STATE, errorReporter, FAILED_STATE, printlnReporter, props, RUNNING_STATE, STARTING_STATE, STOPPED_STATE, STOPPING_STATE, warningReporter |
| Constructor Summary | |
|---|---|
FileReporter()
|
|
| Method Summary | |
|---|---|
void |
debug(java.lang.Object objectRef,
java.lang.String message)
Use this method to report an event for debugging. |
void |
error(java.lang.Object objectRef,
java.lang.String message)
Use this method to report a critical error with an Exception. |
void |
error(java.lang.Object objectRef,
java.lang.String message,
java.lang.Exception e)
Use this method to report a critical error message. |
void |
initProps()
Initializes this agent's properties by providing default values for each of the following missing properties: "log_type" sets the type of log file to be used (default: FILE), "log_file_prefix specifies the prefix for the log_file (default: log_), "logs_per_file" specifies the maximum log entries per file (default: 10000). |
void |
println(java.lang.Object objectRef,
java.lang.String message)
Use this method to report an event message. |
void |
start()
Creates new logSync object, creates the log file, and registers with the service manager. |
void |
warning(java.lang.Object objectRef,
java.lang.String message)
Use this method to report a warning message. |
void |
warning(java.lang.Object objectRef,
java.lang.String message,
java.lang.Exception e)
Use this method to report a warning message with an Exception. |
| Methods inherited from class com.cometway.io.FileLoggerAgent |
|---|
closeLogFile, createLogFile, log |
| Methods inherited from class com.cometway.ak.ServiceAgent |
|---|
stop |
| Methods inherited from class com.cometway.ak.Agent |
|---|
currentStateEquals, debug, destroy, error, error, getAgentController, getDateTimeStr, getProps, getServiceImpl, getStateMachineModel, println, register, registerService, setAgentController, setProps, toString, unregister, unregisterService, warning, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.text.SimpleDateFormat SDF
protected static final java.lang.String DEBUG_BEFORE
protected static final java.lang.String DEBUG_AFTER
protected static final java.lang.String ERROR_BEFORE
protected static final java.lang.String ERROR_AFTER
protected static final java.lang.String PRINTLN_BEFORE
protected static final java.lang.String PRINTLN_AFTER
protected static final java.lang.String WARNING_BEFORE
protected static final java.lang.String WARNING_AFTER
protected java.lang.Object synchObject
protected ReporterInterface defaultReporter
protected boolean log_println
protected boolean log_debug
protected boolean log_warning
protected boolean log_error
protected boolean echo_println
protected boolean echo_debug
protected boolean echo_warning
protected boolean echo_error
| Constructor Detail |
|---|
public FileReporter()
| Method Detail |
|---|
public void initProps()
FileLoggerAgent
initProps in interface AgentInterfaceinitProps in class FileLoggerAgentpublic void start()
FileLoggerAgent
start in interface AgentInterfacestart in class FileLoggerAgent
public void debug(java.lang.Object objectRef,
java.lang.String message)
debug in interface ReporterInterface
public void warning(java.lang.Object objectRef,
java.lang.String message)
warning in interface ReporterInterface
public void warning(java.lang.Object objectRef,
java.lang.String message,
java.lang.Exception e)
warning in interface ReporterInterface
public void error(java.lang.Object objectRef,
java.lang.String message)
error in interface ReporterInterface
public void error(java.lang.Object objectRef,
java.lang.String message,
java.lang.Exception e)
error in interface ReporterInterface
public void println(java.lang.Object objectRef,
java.lang.String message)
println in interface ReporterInterface
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||