public class LocalLogBackend extends Object implements LogBackend
You can set the log level by setting the System.setProperty(LocalLogBackend.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(LocalLogBackend.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 com\.foo\.yourclass.*=DEBUG com\.foo\.yourclass\.BaseMappedStatement=TRACE com\.foo\.yourclass\.MappedCreate=TRACE com\.foo\.yourclass\.StatementExecutor=TRACE
Modifier and Type | Class and Description |
---|---|
static class |
LocalLogBackend.LocalLogBackendFactory
Internal factory for LocalLogBackend instances.
|
Modifier and Type | Field and Description |
---|---|
static String |
LOCAL_LOG_FILE_PROPERTY |
static String |
LOCAL_LOG_LEVEL_PROPERTY |
static String |
LOCAL_LOG_PROPERTIES_FILE |
Constructor and Description |
---|
LocalLogBackend(String className) |
Modifier and Type | Method and Description |
---|---|
boolean |
isLevelEnabled(Level level)
Returns true if the log level argument is enabled meaning that the log messages should be shown.
|
void |
log(Level level,
String msg)
Log a message.
|
void |
log(Level level,
String msg,
Throwable throwable)
Log a message with a throwable which is guaranteed to not be null.
|
static void |
openLogFile(String logPath)
Reopen the associated static logging stream.
|
public static final String LOCAL_LOG_LEVEL_PROPERTY
public static final String LOCAL_LOG_FILE_PROPERTY
public static final String LOCAL_LOG_PROPERTIES_FILE
public LocalLogBackend(String className)
public static void openLogFile(String logPath)
public boolean isLevelEnabled(Level level)
LogBackend
isLevelEnabled
in interface LogBackend
public void log(Level level, String msg)
LogBackend
log
in interface LogBackend
public void log(Level level, String msg, Throwable throwable)
LogBackend
log
in interface LogBackend
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.