public class LogConfiguration
extends java.lang.Object
Logger, will affect all logs
logged by the Logger.
Use the LogConfiguration.Builder to construct a LogConfiguration object.
| Modifier and Type | Class and Description |
|---|---|
static class |
LogConfiguration.Builder
Builder for
LogConfiguration. |
| Modifier and Type | Field and Description |
|---|---|
BorderFormatter |
borderFormatter
The border formatter used to format the border when logging.
|
java.util.List<Interceptor> |
interceptors
The interceptors, used to intercept the log when logging.
|
JsonFormatter |
jsonFormatter
The JSON formatter used to format the JSON string when log a JSON string.
|
int |
logLevel
The log level, the logs below of which would not be printed.
|
int |
stackTraceDepth
The number of stack trace elements we should log when logging with stack trace,
0 if no limitation.
|
StackTraceFormatter |
stackTraceFormatter
The stack trace formatter used to format the stack trace when logging.
|
java.lang.String |
stackTraceOrigin
The origin of stack trace elements from which we should not log when logging with stack trace,
it can be a package name like "com.elvishew.xlog", a class name like "com.yourdomain.logWrapper",
or something else between package name and class name, like "com.yourdomain.".
|
java.lang.String |
tag
The tag string.
|
ThreadFormatter |
threadFormatter
The thread formatter used to format the thread when logging.
|
ThrowableFormatter |
throwableFormatter
The throwable formatter used to format the throwable when log a message with throwable.
|
boolean |
withBorder
Whether we should log with border.
|
boolean |
withStackTrace
Whether we should log with stack trace.
|
boolean |
withThread
Whether we should log with thread info.
|
XmlFormatter |
xmlFormatter
The XML formatter used to format the XML string when log a XML string.
|
| Modifier and Type | Method and Description |
|---|---|
<T> ObjectFormatter<? super T> |
getObjectFormatter(T object)
Get
ObjectFormatter for specific object. |
public final int logLevel
public final java.lang.String tag
public final boolean withThread
public final boolean withStackTrace
public final java.lang.String stackTraceOrigin
It is mostly used when you are using a logger wrapper.
public final int stackTraceDepth
public final boolean withBorder
public final JsonFormatter jsonFormatter
public final XmlFormatter xmlFormatter
public final ThrowableFormatter throwableFormatter
public final ThreadFormatter threadFormatter
public final StackTraceFormatter stackTraceFormatter
public final BorderFormatter borderFormatter
public final java.util.List<Interceptor> interceptors
public <T> ObjectFormatter<? super T> getObjectFormatter(T object)
ObjectFormatter for specific object.T - the type of objectobject - the object