|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.logging.Logging
public class Logging
Main logging class.
It supports use of both log4j and java.util.logging
logging facilities.
First it tries to use log4j logging. If this attempt fails, it uses java.util.logging
logging,
so you'll always have some logging running.
Usage pattern:
public class SomeClass {
private static final Logging log = Logging.getLogging(SomeClass.class);
}
Log4jLogging
,
DefaultLogging
,
LogFormatter
Field Summary | |
---|---|
static String |
DEFAULT_MAX_FILE_SIZE
|
static String |
ERR_FILE_PROPERTY
|
static String |
ERR_MAX_FILE_SIZE_PROPERTY
|
static String |
LOG_FILE_PROPERTY
|
static String |
LOG_MAX_FILE_SIZE_PROPERTY
|
Constructor Summary | |
---|---|
protected |
Logging()
This constructor is designed for abstract framework classes like BeanBase or DAOBase that extend Logging to decorate messages by overriding decorateLogMessage(String) method. |
protected |
Logging(String name)
|
Method Summary | |
---|---|
void |
configureDebugEnabled(boolean default_debug_enabled)
Changes default debugEnabled() behaviour for this logging instance. |
static void |
configureLogFile(String log_file)
Programmatically reconfigures logging to a specified file. |
void |
debug(String message)
|
void |
debug(String message,
Throwable t)
|
boolean |
debugEnabled()
|
protected String |
decorateLogMessage(String msg)
Decorates log message (reformatting, auditing, etc). |
void |
error(String message)
|
void |
error(String message,
Throwable t)
|
static Logging |
getLogging(Class<?> clazz)
|
static Logging |
getLogging(String name)
|
void |
info(String message)
|
void |
info(String message,
Throwable t)
|
RuntimeException |
log(RuntimeException e)
|
void |
warn(String message)
|
void |
warn(String message,
Throwable t)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LOG_FILE_PROPERTY
public static final String ERR_FILE_PROPERTY
public static final String LOG_MAX_FILE_SIZE_PROPERTY
public static final String ERR_MAX_FILE_SIZE_PROPERTY
public static final String DEFAULT_MAX_FILE_SIZE
Constructor Detail |
---|
protected Logging()
decorateLogMessage(String)
method.
protected Logging(String name)
Method Detail |
---|
public static Logging getLogging(Class<?> clazz)
public static Logging getLogging(String name)
public static void configureLogFile(String log_file)
LOG_FILE_PROPERTY
system property.
public final void configureDebugEnabled(boolean default_debug_enabled)
debugEnabled()
behaviour for this logging instance.
Use this method to turn off debugging information for classes that do not
need to print their debugging information in production environment.
public final boolean debugEnabled()
public final void debug(String message)
public final void debug(String message, Throwable t)
public final void info(String message)
public final void info(String message, Throwable t)
public final void warn(String message)
public final void warn(String message, Throwable t)
public final void error(String message)
public final void error(String message, Throwable t)
public final RuntimeException log(RuntimeException e)
protected String decorateLogMessage(String msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |