|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openpipeline.logger.LoggerImpl
public class LoggerImpl
Provides a means of sending output to a general log file. Log files are used for reporting important system events, including searches and errors. Log files are named "prefix-yyyy-mm-dd.log" and get rolled over on a daily basis. The encoding for the output is UTF-8.
| Field Summary | |
|---|---|
static String |
DEBUG
|
static String |
ERROR
|
static String |
INFO
|
static String |
WARN
|
| Constructor Summary | |
|---|---|
LoggerImpl(String logdir,
String prefix)
Create a logger in the specified directory, and name the file starting with the specified prefix. |
|
| Method Summary | |
|---|---|
void |
close()
Close the log file. |
void |
debug(String message)
|
void |
debug(String message,
Throwable t)
|
void |
error(String message)
|
void |
error(String message,
Throwable t)
|
void |
info(char[] message,
int offset,
int len)
|
void |
info(String message)
|
void |
setConsole(boolean console)
Set to true to dump log messages to the console (System.out). |
void |
setFlushEveryMessage(boolean flushEveryMessage)
Set this false to allow the system to buffer messages before they are written to disk. |
void |
setIncludeElapsed(boolean includeElapsed)
Set whether to include the elapsed time in milliseconds after the timestamp in each log entry. |
void |
setIncludeMsgType(boolean includeMsgType)
Set whether to include the type of message in the entry, for example, "INFO", "WARN", etc. |
void |
setIncludeTimestamp(boolean includeTimestamp)
Set whether to include a timestamp as the first field in each entry. |
void |
setLogging(boolean logging)
Set logging on or off. |
void |
warn(String message)
|
void |
warn(String message,
Throwable t)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String INFO
public static final String WARN
public static final String DEBUG
public static final String ERROR
| Constructor Detail |
|---|
public LoggerImpl(String logdir,
String prefix)
It's better to use LoggerFactory to get a logger instance.
| Method Detail |
|---|
public void info(char[] message,
int offset,
int len)
info in interface Loggerpublic void info(String message)
info in interface Loggerpublic void warn(String message)
warn in interface Logger
public void warn(String message,
Throwable t)
warn in interface Loggerpublic void debug(String message)
debug in interface Logger
public void debug(String message,
Throwable t)
debug in interface Loggerpublic void error(String message)
error in interface Logger
public void error(String message,
Throwable t)
error in interface Loggerpublic void close()
close in interface Loggerpublic void setLogging(boolean logging)
logging - set true to enable (default) or false to disable.public void setConsole(boolean console)
console - default is false.public void setFlushEveryMessage(boolean flushEveryMessage)
public void setIncludeElapsed(boolean includeElapsed)
public void setIncludeTimestamp(boolean includeTimestamp)
public void setIncludeMsgType(boolean includeMsgType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||