|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.j256.ormlite.logger.LocalLog
public class LocalLog
Class which implements our Log
interface so we can bypass external logging classes if they are not available.
You can set the log level by setting the System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "trace"). Acceptable values are: TRACE, DEBUG, INFO, WARN, ERROR, and FATAL. You can also redirect the log to a file by setting the System.setProperty(LocalLog.LOCAL_LOG_FILE_PROPERTY, "log.out"). Otherwise, log output will go to stdout.
It also supports a file ormliteLocalLog.properties file which contains lines such as:
# regex-pattern = Level log4j\.logger\.com\.j256\.ormlite.*=DEBUG log4j\.logger\.com\.j256\.ormlite\.stmt\.mapped.BaseMappedStatement=TRACE log4j\.logger\.com\.j256\.ormlite\.stmt\.mapped.MappedCreate=TRACE log4j\.logger\.com\.j256\.ormlite\.stmt\.StatementExecutor=TRACE
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.j256.ormlite.logger.Log |
---|
Log.Level |
Field Summary | |
---|---|
static String |
LOCAL_LOG_FILE_PROPERTY
|
static String |
LOCAL_LOG_LEVEL_PROPERTY
|
static String |
LOCAL_LOG_PROPERTIES_FILE
|
Constructor Summary | |
---|---|
LocalLog(String className)
|
Method Summary | |
---|---|
boolean |
isLevelEnabled(Log.Level level)
Returns true if the log mode is in trace or higher. |
void |
log(Log.Level level,
String msg)
Log a trace message. |
void |
log(Log.Level level,
String msg,
Throwable throwable)
Log a trace message with a throwable. |
static void |
openLogFile(String logPath)
Reopen the associated static logging stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LOCAL_LOG_LEVEL_PROPERTY
public static final String LOCAL_LOG_FILE_PROPERTY
public static final String LOCAL_LOG_PROPERTIES_FILE
Constructor Detail |
---|
public LocalLog(String className)
Method Detail |
---|
public static void openLogFile(String logPath)
public boolean isLevelEnabled(Log.Level level)
Log
isLevelEnabled
in interface Log
public void log(Log.Level level, String msg)
Log
log
in interface Log
public void log(Log.Level level, String msg, Throwable throwable)
Log
log
in interface Log
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |