|
|||||||||
| 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.ak.RequestAgent
com.cometway.httpd.LogViewerPage
public class LogViewerPage
This agent registers itself into the ServiceManager and accepts http requests to view information stored in log files. Given a directory, this agent will look for all the files in that directory and treat them as log files. The agent uses a mapping which provides information about how these files should be displayed. The logfile mapping maps a name to a text pattern. The agent will display the names and the matching lines of the log files.
| Field Summary |
|---|
| 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 | |
|---|---|
LogViewerPage()
|
|
| Method Summary | |
|---|---|
protected java.lang.String |
convert(java.lang.String in)
Converts a String to HTML text. |
protected java.lang.String |
getForm()
Displays log file information in a form. |
void |
handleRequest(AgentRequest request)
Handles request and gets log file information and displays as HTML data. |
void |
initProps()
Initializes this agent's properties by providing default values for each of the following missing properties: "log_dir" specifies the directory where the log file is located (default: ./), "log_map_file" specifies the file to map the logs to (default: ./log.maps), "log_file_suffix" specifies the suffix of the log file (default: httpd.log), "check_interval" specifies the time between checks (default: 600000), "service_name" specifies the name to register this agent as with the Object Manager (default: /logviewer.agent), "is_logger_output" (default: TRUE), "max_show_log_length" (default: 50000), "show memory_usage" (default: false). |
void |
parseInfo(java.util.Hashtable matches,
java.util.Hashtable patterns,
boolean storeMatches)
Parses log file information in hash table, searches for patterns and stores matches. |
protected void |
readLogMapping()
Reads Log file Mappings and outputs maps read. |
void |
run()
Runs log parsing routines. |
void |
start()
Starts new thread, gets new logMaps, counts, names list and registers this service with the Object Manager. |
void |
stop()
Unregisters this instance with the service manager using the service_name property. |
void |
updateLogCache()
|
| 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 |
| Constructor Detail |
|---|
public LogViewerPage()
| Method Detail |
|---|
public void initProps()
initProps in interface AgentInterfaceinitProps in class Agentpublic void start()
start in interface AgentInterfacestart in class ServiceAgentpublic void stop()
ServiceAgent
stop in interface AgentInterfacestop in class ServiceAgentpublic void handleRequest(AgentRequest request)
handleRequest in interface RequestAgentInterfaceprotected java.lang.String convert(java.lang.String in)
protected java.lang.String getForm()
public void run()
run in interface java.lang.Runnablepublic void updateLogCache()
public void parseInfo(java.util.Hashtable matches,
java.util.Hashtable patterns,
boolean storeMatches)
protected void readLogMapping()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||