|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.paho.client.mqttv3.logging.JSR47Logger
public class JSR47Logger
Implementation of the the logger interface that uses java.uti.logging A Logger that utilises Java's built in logging facility - java.util.logging.
A sample java.util.logging properties file - jsr47min.properties is provided that demonstrates
how to run with a memory based trace facility that runs with minimal performance
overhead. The memory buffer can be dumped when a log/trace record is written matching
the MemoryHandlers trigger level or when the push method is invoked on the MemoryHandler.
Debug
provides method to make it easy
to dump the memory buffer as well as other useful debug info.
Field Summary |
---|
Fields inherited from interface org.eclipse.paho.client.mqttv3.logging.Logger |
---|
CONFIG, FINE, FINER, FINEST, INFO, SEVERE, WARNING |
Constructor Summary | |
---|---|
JSR47Logger()
|
Method Summary | |
---|---|
void |
config(String sourceClass,
String sourceMethod,
String msg)
Log a message, specifying source class and method, if the logger is currently enabled for the given message level. |
void |
config(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts)
Log a message, specifying source class and method, with an array of object arguments, if the logger is currently enabled for the given message level. |
void |
config(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts,
Throwable thrown)
Log a message, specifying source class and method, with an array of object arguments and a throwable, if the logger is currently enabled for the given message level. |
protected static void |
dumpMemoryTrace47(Logger logger)
|
void |
dumpTrace()
|
void |
fine(String sourceClass,
String sourceMethod,
String msg)
Trace a message, specifying source class and method, if the logger is currently enabled for the given message level. |
void |
fine(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts)
Trace a message, specifying source class and method, with an array of object arguments, if the logger is currently enabled for the given message level. |
void |
fine(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts,
Throwable ex)
|
void |
finer(String sourceClass,
String sourceMethod,
String msg)
Trace a message, specifying source class and method, if the logger is currently enabled for the given message level. |
void |
finer(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts)
Trace a message, specifying source class and method, with an array of object arguments, if the logger is currently enabled for the given message level. |
void |
finer(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts,
Throwable ex)
|
void |
finest(String sourceClass,
String sourceMethod,
String msg)
Trace a message, specifying source class and method, if the logger is currently enabled for the given message level. |
void |
finest(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts)
Trace a message, specifying source class and method, with an array of object arguments, if the logger is currently enabled for the given message level. |
void |
finest(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts,
Throwable ex)
|
String |
formatMessage(String msg,
Object[] inserts)
Format a log message without causing it to be written to the log. |
void |
info(String sourceClass,
String sourceMethod,
String msg)
Log a message, specifying source class and method, if the logger is currently enabled for the given message level. |
void |
info(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts)
Log a message, specifying source class and method, with an array of object arguments, if the logger is currently enabled for the given message level. |
void |
info(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts,
Throwable thrown)
Log a message, specifying source class and method, with an array of object arguments and a throwable, if the logger is currently enabled for the given message level. |
void |
initialise(ResourceBundle logMsgCatalog,
String loggerID,
String resourceContext)
|
boolean |
isLoggable(int level)
Check if a message of the given level would actually be logged by this logger. |
void |
log(int level,
String sourceClass,
String sourceMethod,
String msg,
Object[] inserts,
Throwable thrown)
Log a message, specifying source class and method, with an array of object arguments and a throwable, if the logger is currently enabled for the given message level. |
void |
setResourceName(String logContext)
Set a name that can be used to provide context with each log record. |
void |
severe(String sourceClass,
String sourceMethod,
String msg)
Log a message, specifying source class and method, if the logger is currently enabled for the given message level. |
void |
severe(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts)
Log a message, specifying source class and method, with an array of object arguments, if the logger is currently enabled for the given message level. |
void |
severe(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts,
Throwable thrown)
Log a message, specifying source class and method, with an array of object arguments and a throwable, if the logger is currently enabled for the given message level. |
void |
trace(int level,
String sourceClass,
String sourceMethod,
String msg,
Object[] inserts,
Throwable ex)
Log a trace message, specifying source class and method, with an array of object arguments and a throwable, if the logger is currently enabled for the given message level. |
void |
warning(String sourceClass,
String sourceMethod,
String msg)
Log a message, specifying source class and method, if the logger is currently enabled for the given message level. |
void |
warning(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts)
Log a message, specifying source class and method, with an array of object arguments, if the logger is currently enabled for the given message level. |
void |
warning(String sourceClass,
String sourceMethod,
String msg,
Object[] inserts,
Throwable thrown)
Log a message, specifying source class and method, with an array of object arguments and a throwable, if the logger is currently enabled for the given message level. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSR47Logger()
Method Detail |
---|
public void initialise(ResourceBundle logMsgCatalog, String loggerID, String resourceContext)
initialise
in interface Logger
logMsgCatalog
- The resource bundle associated with this loggerloggerID
- The suffix for the loggerName (will be appeneded to org.eclipse.paho.client.mqttv3resourceContext
- A context for the logger e.g. clientID or appName...public void setResourceName(String logContext)
Logger
setResourceName
in interface Logger
public boolean isLoggable(int level)
Logger
isLoggable
in interface Logger
level
- a message logging level.
public void severe(String sourceClass, String sourceMethod, String msg)
Logger
severe
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used.public void severe(String sourceClass, String sourceMethod, String msg, Object[] inserts)
Logger
severe
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used. The formatter uses java.text.MessageFormat
style formatting to format parameters, so for example a format
string "{0} {1}" would format two inserts into the message.inserts
- Array of parameters to the message.public void severe(String sourceClass, String sourceMethod, String msg, Object[] inserts, Throwable thrown)
Logger
severe
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used. The formatter uses java.text.MessageFormat
style formatting to format parameters, so for example a format
string "{0} {1}" would format two inserts into the message.inserts
- Array of parameters to the message.thrown
- Throwable associated with log message.public void warning(String sourceClass, String sourceMethod, String msg)
Logger
warning
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used.public void warning(String sourceClass, String sourceMethod, String msg, Object[] inserts)
Logger
warning
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used. The formatter uses java.text.MessageFormat
style formatting to format parameters, so for example a format
string "{0} {1}" would format two inserts into the message.inserts
- Array of parameters to the message.public void warning(String sourceClass, String sourceMethod, String msg, Object[] inserts, Throwable thrown)
Logger
warning
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used. The formatter uses java.text.MessageFormat
style formatting to format parameters, so for example a format
string "{0} {1}" would format two inserts into the message.inserts
- Array of parameters to the message.thrown
- Throwable associated with log message.public void info(String sourceClass, String sourceMethod, String msg)
Logger
info
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used.public void info(String sourceClass, String sourceMethod, String msg, Object[] inserts)
Logger
info
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used. The formatter uses java.text.MessageFormat
style formatting to format parameters, so for example a format
string "{0} {1}" would format two inserts into the message.inserts
- Array of parameters to the message.public void info(String sourceClass, String sourceMethod, String msg, Object[] inserts, Throwable thrown)
Logger
info
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used. The formatter uses java.text.MessageFormat
style formatting to format parameters, so for example a format
string "{0} {1}" would format two inserts into the message.inserts
- Array of parameters to the message.thrown
- Throwable associated with log message.public void config(String sourceClass, String sourceMethod, String msg)
Logger
config
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used.public void config(String sourceClass, String sourceMethod, String msg, Object[] inserts)
Logger
config
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used. The formatter uses java.text.MessageFormat
style formatting to format parameters, so for example a format
string "{0} {1}" would format two inserts into the message.inserts
- Array of parameters to the message.public void config(String sourceClass, String sourceMethod, String msg, Object[] inserts, Throwable thrown)
Logger
config
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used. The formatter uses java.text.MessageFormat
style formatting to format parameters, so for example a format
string "{0} {1}" would format two inserts into the message.inserts
- Array of parameters to the message.thrown
- Throwable associated with log message.public void log(int level, String sourceClass, String sourceMethod, String msg, Object[] inserts, Throwable thrown)
Logger
log
in interface Logger
level
- One of the message level identifiers, e.g. SEVERE.sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used. The formatter uses java.text.MessageFormat
style formatting to format parameters, so for example a format
string "{0} {1}" would format two inserts into the message.inserts
- Array of parameters to the message, may be null.thrown
- Throwable associated with log message.public void fine(String sourceClass, String sourceMethod, String msg)
Logger
fine
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message catalog for the message or the actual
message itself. During formatting, if the logger has a mapping
for the msg string, then the msg string is replaced by the
value. Otherwise the original msg string is used.public void fine(String sourceClass, String sourceMethod, String msg, Object[] inserts)
Logger
fine
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message catalog for the message or the actual
message itself. During formatting, if the logger has a mapping
for the msg string, then the msg string is replaced by the
value. Otherwise the original msg string is used. The
formatter uses java.text.MessageFormat style formatting to
format parameters, so for example a format string "{0} {1}"
would format two inserts into the message.inserts
- Array of parameters to the message.public void fine(String sourceClass, String sourceMethod, String msg, Object[] inserts, Throwable ex)
fine
in interface Logger
public void finer(String sourceClass, String sourceMethod, String msg)
Logger
finer
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message catalog for the message or the actual
message itself. During formatting, if the logger has a mapping
for the msg string, then the msg string is replaced by the
value. Otherwise the original msg string is used.public void finer(String sourceClass, String sourceMethod, String msg, Object[] inserts)
Logger
finer
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message catalog for the message or the actual
message itself. During formatting, if the logger has a mapping
for the msg string, then the msg string is replaced by the
value. Otherwise the original msg string is used. The
formatter uses java.text.MessageFormat style formatting to
format parameters, so for example a format string "{0} {1}"
would format two inserts into the message.inserts
- Array of parameters to the message.public void finer(String sourceClass, String sourceMethod, String msg, Object[] inserts, Throwable ex)
finer
in interface Logger
public void finest(String sourceClass, String sourceMethod, String msg)
Logger
finest
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message catalog for the message or the actual
message itself. During formatting, if the logger has a mapping
for the msg string, then the msg string is replaced by the
value. Otherwise the original msg string is used.public void finest(String sourceClass, String sourceMethod, String msg, Object[] inserts)
Logger
finest
in interface Logger
sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message catalog for the message or the actual
message itself. During formatting, if the logger has a mapping
for the msg string, then the msg string is replaced by the
value. Otherwise the original msg string is used. The
formatter uses java.text.MessageFormat style formatting to
format parameters, so for example a format string "{0} {1}"
would format two inserts into the message.inserts
- Array of parameters to the message.public void finest(String sourceClass, String sourceMethod, String msg, Object[] inserts, Throwable ex)
finest
in interface Logger
public void trace(int level, String sourceClass, String sourceMethod, String msg, Object[] inserts, Throwable ex)
Logger
trace
in interface Logger
level
- One of the message level identifiers, e.g. SEVERE.sourceClass
- Name of class that issued the logging request.sourceMethod
- Name of method that issued the logging request.msg
- The key in the message catalog for the message or the actual
message itself. During formatting, if the logger has a mapping
for the msg string, then the msg string is replaced by the
value. Otherwise the original msg string is used. The
formatter uses java.text.MessageFormat style formatting to
format parameters, so for example a format string "{0} {1}"
would format two inserts into the message.inserts
- Array of parameters to the message, may be null.public String formatMessage(String msg, Object[] inserts)
Logger
formatMessage
in interface Logger
msg
- The key in the message localization catalog for the message or
the actual message itself. During formatting, if the logger
has a mapping for the msg string, then the msg string is
replaced by the localized value. Otherwise the original msg
string is used. The formatter uses java.text.MessageFormat
style formatting to format parameters, so for example a format
string "{0} {1}" would format two inserts into the message.inserts
- Array of parameters to the message.
public void dumpTrace()
dumpTrace
in interface Logger
protected static void dumpMemoryTrace47(Logger logger)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |