|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.logging.Logger org.brains2b.log.Logger
Prints log messages to selected output or if not set to default output on the basis of a defined outputlevel and Logger level
The default level of the Logger is ERROR, so all panic,info and error messages
are written.
You can influence the behaviour of Logger through properties. Those properties can either be defined by setting System properties or by placing a file named logger.properties in the root for the java application or in a directory conf/ in that root.
A property can be defined on either of these levels. If they are defined on both levels the System properties will overwrite the file properties.
Nested Class Summary | |
static class |
Logger.ClassicFormatter
Implementation of Formatter to be consistant with The old-style Logger's formatting |
Field Summary | |
static int |
DEBUG
|
static int |
DEBUG_VERBOSE
Output level for DEBUG statements which might have a notable influence on the overal performance. |
static int |
ERROR
|
static int |
INFO
|
static int |
PANIC
|
static int |
TRACE
|
static int |
WARNING
|
Fields inherited from class java.util.logging.Logger |
global |
Constructor Summary | |
protected |
Logger(java.lang.String name,
java.lang.String resourceBundle)
|
Method Summary | |
static Logger |
getLogger()
get the default TwelBox logger |
protected static Logger |
instance()
Deprecated. use getLogger() instead |
static void |
print(java.lang.Object o)
Prints the Object to the standard or defined output, irrespective of the level |
static void |
print(java.lang.Object o,
int level)
Prints the Object to the standard or defined output, if the level given is smaller or equal to the Logger.level |
static void |
printException(java.lang.Exception ex)
Uses printException(String,Exception) to write the Exception message to the standard or defined error stream if the level of logger is greater or equal to ERROR, and writing the complete stack trace underneath if the logger is set to DEBUG or DEBUG_VERBOSE. |
static void |
printException(java.lang.String message,
java.lang.Exception ex)
Writes the message to the standard or defined error stream if the level of logger is greater or equal to ERROR, writes the complete stack trace underneath if the logger is set to DEBUG or DEBUG_VERBOSE. |
static void |
println(java.lang.String str)
Prints the String to the standard or defined output, irrespective of the level |
static void |
println(java.lang.String str,
int level)
Prints the String to the standard or defined output, if the level given is smaller or equal to the Logger.level |
static void |
setLevel(int level)
sets the Logger level programmatically. |
Methods inherited from class java.util.logging.Logger |
addHandler, config, entering, entering, entering, exiting, exiting, fine, finer, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getHandlers, getLevel, getLogger, getLogger, getName, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, isLoggable, log, log, log, log, log, logp, logp, logp, logp, logrb, logrb, logrb, logrb, removeHandler, setFilter, setLevel, setParent, setUseParentHandlers, severe, throwing, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PANIC
public static final int INFO
public static final int ERROR
public static final int WARNING
public static final int TRACE
public static final int DEBUG
public static final int DEBUG_VERBOSE
Constructor Detail |
protected Logger(java.lang.String name, java.lang.String resourceBundle)
Method Detail |
protected static Logger instance()
just a Singleton implementation
public static Logger getLogger()
public static void setLevel(int level)
It was implemented for test purposes only
level
- int, the print level.public static void println(java.lang.String str)
str
- Stringpublic static void print(java.lang.Object o)
o
- ObjectObject.toString()
public static void println(java.lang.String str, int level)
str
- Stringlevel
- intpublic static void print(java.lang.Object o, int level)
o
- Objectlevel
- intObject.toString()
public static void printException(java.lang.String message, java.lang.Exception ex)
message
- Stringex
- Exceptionpublic static void printException(java.lang.Exception ex)
ex
- ExceptionprintException(String, Exception)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |