|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mondemand.Client
public class Client
This is the main entry point to MonDemand. Users can create client objects and use them to log messages and statistics.
| Constructor Summary | |
|---|---|
Client(String programId)
The constructor creates a Client object that is ready to use. |
|
| Method Summary | |
|---|---|
void |
addContext(String key,
String value)
Adds contextual data to the client. |
void |
addTransport(Transport transport)
Adds a new transport to this client. |
void |
alert(String message)
A convenience method to log a message at priority level ALERT |
void |
alert(String name,
int line,
TraceId traceId,
String message,
Object[] args)
Logs a message a priority level ALERT. |
void |
alert(TraceId traceId,
String message,
Object[] args)
Logs a message a priority level ALERT, determining the calling class and line number on the fly. |
void |
crit(String message)
A convenience method to log a message at priority level CRIT |
void |
crit(String name,
int line,
TraceId traceId,
String message,
Object[] args)
Logs a message at priority level CRIT |
void |
crit(TraceId traceId,
String message,
Object[] args)
Logs a message a priority level CRIT, determining the calling class and line number on the fly. |
void |
debug(String message)
A convenience method to log a message at priority level DEBUG |
void |
debug(String name,
int line,
TraceId traceId,
String message,
Object[] args)
Logs a message at priority level DEBUG |
void |
debug(TraceId traceId,
String message,
Object[] args)
Logs a message a priority level DEBUG, determining the calling class and line number on the fly. |
void |
decrement()
Decrements the default counter by one. |
void |
decrement(int value)
Decrements the default counter by value |
void |
decrement(StatType type,
String key,
int value)
|
void |
decrement(String key)
Decrements the specified counter by one. |
void |
decrement(String key,
int value)
Decrements the specified counter by the value specified. |
void |
emerg(String message)
A convenience method to log a message a log level EMERG. |
void |
emerg(String name,
int line,
TraceId traceId,
String message,
Object[] args)
Logs a message at priority level EMERG |
void |
emerg(TraceId traceId,
String message,
Object[] args)
Logs a message a priority level EMERG, determining the calling class and line number on the fly. |
void |
error(String message)
A convenience method to log a message at priority level ERROR |
void |
error(String name,
int line,
TraceId traceId,
String message,
Object[] args)
Logs a message at priority level ERROR |
void |
error(TraceId traceId,
String message,
Object[] args)
Logs a message a priority level ERROR, determining the calling class and line number on the fly. |
void |
finalize()
Called when the client is destroyed. |
void |
flush()
|
void |
flushLogs()
Flushes log data to the transports. |
void |
flushStats()
Flushes statistics to the transports. |
void |
flushStats(boolean reset)
Flushes statistics to the transports, but allows one to specify whether or not to reset the running statistics. |
String |
getContext(String key)
Fetches contextual data from the client. |
Enumeration<String> |
getContextKeys()
Retrieves an enumeration of all the contextual data keys |
ErrorHandler |
getErrorHandler()
|
int |
getImmediateSendLevel()
|
int |
getNoSendLevel()
|
String |
getProgramId()
|
void |
increment()
Increments the default counter by one. |
void |
increment(int value)
Increments the default counter by value |
void |
increment(StatType type,
String key,
int value)
|
void |
increment(String key)
Increments the specified counter by one. |
void |
increment(String key,
int value)
Increments the specified counter by the value specified. |
void |
info(String message)
A convenience method to log a message at priority level INFO |
void |
info(String name,
int line,
TraceId traceId,
String message,
Object[] args)
Logs a message at priority level INFO |
void |
info(TraceId traceId,
String message,
Object[] args)
Logs a message a priority level INFO, determining the calling class and line number on the fly. |
boolean |
levelIsEnabled(int level,
TraceId traceId)
A check for the log level that is set. |
void |
log(int level,
TraceId traceId,
String message,
Object[] args)
Generic logger function. |
void |
log(String name,
int line,
int level,
TraceId traceId,
String message,
Object[] args)
The most generic logger function. |
void |
notice(String message)
A convenience method to log a message at priority level NOTICE |
void |
notice(String name,
int line,
TraceId traceId,
String message,
Object[] args)
Logs a message at priority level NOTICE |
void |
notice(TraceId traceId,
String message,
Object[] args)
Logs a message a priority level NOTICE, determining the calling class and line number on the fly. |
void |
removeAllContexts()
Clear contextual data from the logger. |
void |
removeContext(String key)
Removes contextual data from the client. |
void |
setErrorHandler(ErrorHandler errorHandler)
Sets a custom error handler. |
void |
setImmediateSendLevel(int immediateSendLevel)
|
void |
setKey(StatType type,
String key,
long value)
|
void |
setKey(String key,
int value)
Sets the counter to the specified val ue. |
void |
setKey(String key,
long value)
Sets the counter to the specified val ue. |
void |
setNoSendLevel(int noSendLevel)
|
void |
setProgramId(String programId)
|
boolean |
traceMessage(String message,
Map<String,String> context)
|
boolean |
traceMessage(String owner,
String traceId,
String message,
Map<String,String> context)
|
void |
warning(String message)
A convenience method to log a message at priority level WARNING |
void |
warning(String name,
int line,
TraceId traceId,
String message,
Object[] args)
Logs a message at priority level WARNING |
void |
warning(TraceId traceId,
String message,
Object[] args)
Logs a message a priority level WARNING, determining the calling class and line number on the fly. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Client(String programId)
programId - a string identifying the program that is calling MonDemand| Method Detail |
|---|
public void finalize()
finalize in class Objectpublic String getProgramId()
public void setProgramId(String programId)
programId - the programId to setpublic int getImmediateSendLevel()
public void setImmediateSendLevel(int immediateSendLevel)
immediateSendLevel - the immediateSendLevel to setpublic int getNoSendLevel()
public void setNoSendLevel(int noSendLevel)
noSendLevel - the noSendLevel to setpublic ErrorHandler getErrorHandler()
public void setErrorHandler(ErrorHandler errorHandler)
errorHandler - the errorHandler to set
public void addContext(String key,
String value)
public void removeContext(String key)
public String getContext(String key)
public Enumeration<String> getContextKeys()
public void removeAllContexts()
public void addTransport(Transport transport)
transport - the transport object to add
public boolean levelIsEnabled(int level,
TraceId traceId)
level - the priority level to checktraceId - the TraceId to check for
public void flushLogs()
public void flushStats()
public void flushStats(boolean reset)
public void flush()
public void increment()
public void increment(int value)
value - the amount to increment the counter bypublic void increment(String key)
key - the name of the counter to increment
public void increment(String key,
int value)
key - the name of the counter to incrementvalue - the amount to increment the counter by
public void increment(StatType type,
String key,
int value)
public void decrement()
public void decrement(int value)
value - the amount to decrement the counter bypublic void decrement(String key)
key - the name of the counter to decrement
public void decrement(String key,
int value)
key - the name of the counter to decrementvalue - the amount to decrement the counter by
public void decrement(StatType type,
String key,
int value)
public void setKey(String key,
int value)
key - the name of the counter key to setvalue - the value to set this counter to
public void setKey(String key,
long value)
key - the name of the counter key to setvalue - the value to set this counter to
public void setKey(StatType type,
String key,
long value)
public void emerg(String name,
int line,
TraceId traceId,
String message,
Object[] args)
name - the name of the calling class or filenameline - the line number of the calling class or filenametraceId - an optional trace IDmessage - the log messageargs - optional arguments
public void emerg(TraceId traceId,
String message,
Object[] args)
traceId - an optional trace IDmessage - the log messageargs - optional argumentspublic void emerg(String message)
message -
public void alert(String name,
int line,
TraceId traceId,
String message,
Object[] args)
name - the name of the calling class or filenameline - the line number of the calling class or filenametraceId - an optional trace IDmessage - the log messageargs - optional arguments
public void alert(TraceId traceId,
String message,
Object[] args)
traceId - an optional trace IDmessage - the log messageargs - optional argumentspublic void alert(String message)
message - the log message
public void crit(String name,
int line,
TraceId traceId,
String message,
Object[] args)
name - the name of the calling class or filenameline - the line number of the calling class or filenametraceId - an optional trace IDmessage - the log messageargs - optional arguments
public void crit(TraceId traceId,
String message,
Object[] args)
traceId - an optional trace IDmessage - the log messageargs - optional argumentspublic void crit(String message)
message - the log message
public void error(String name,
int line,
TraceId traceId,
String message,
Object[] args)
name - the name of the calling class or filenameline - the line number of the calling class or filenametraceId - an optional trace IDmessage - the log messageargs - optional arguments
public void error(TraceId traceId,
String message,
Object[] args)
traceId - an optional trace IDmessage - the log messageargs - optional argumentspublic void error(String message)
message - the log message
public void warning(String name,
int line,
TraceId traceId,
String message,
Object[] args)
name - the name of the calling class or filenameline - the line number of the calling class or filenametraceId - an optional trace IDmessage - the log messageargs - optional arguments
public void warning(TraceId traceId,
String message,
Object[] args)
traceId - an optional trace IDmessage - the log messageargs - optional argumentspublic void warning(String message)
message - the log message
public void notice(String name,
int line,
TraceId traceId,
String message,
Object[] args)
name - the name of the calling class or filenameline - the line number of the calling class or filenametraceId - an optional trace IDmessage - the log messageargs - optional arguments
public void notice(TraceId traceId,
String message,
Object[] args)
traceId - an optional trace IDmessage - the log messageargs - optional argumentspublic void notice(String message)
message - the log message
public void info(String name,
int line,
TraceId traceId,
String message,
Object[] args)
name - the name of the calling class or filenameline - the line number of the calling class or filenametraceId - an optional trace IDmessage - the log messageargs - optional arguments
public void info(TraceId traceId,
String message,
Object[] args)
traceId - an optional trace IDmessage - the log messageargs - optional argumentspublic void info(String message)
message - the log message
public void debug(String name,
int line,
TraceId traceId,
String message,
Object[] args)
name - the name of the calling class or filenameline - the line number of the calling class or filenametraceId - an optional trace IDmessage - the log messageargs - optional arguments
public void debug(TraceId traceId,
String message,
Object[] args)
traceId - an optional trace IDmessage - the log messageargs - optional argumentspublic void debug(String message)
message - the log message
public void log(int level,
TraceId traceId,
String message,
Object[] args)
level - the log level of this messagetraceId - an optional traceIdmessage - the log messageargs - optional arguments
public void log(String name,
int line,
int level,
TraceId traceId,
String message,
Object[] args)
name - the name of this message, usually the filename or calling classline - the line number calling this message, or other numeric description of the calling classlevel - the log leveltraceId - an optional traceIdmessage - the messageargs - optional arguments
public boolean traceMessage(String message,
Map<String,String> context)
public boolean traceMessage(String owner,
String traceId,
String message,
Map<String,String> context)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||