Package com.elvishew.xlog
Class LogConfiguration
- java.lang.Object
-
- com.elvishew.xlog.LogConfiguration
-
public class LogConfiguration extends java.lang.ObjectThe configuration used for logging, always attached to aLogger, will affect all logs logged by theLogger.Use the
LogConfiguration.Builderto construct aLogConfigurationobject.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLogConfiguration.BuilderBuilder forLogConfiguration.
-
Field Summary
Fields Modifier and Type Field Description BorderFormatterborderFormatterThe border formatter used to format the border when logging.java.util.List<Interceptor>interceptorsThe interceptors, used to intercept the log when logging.JsonFormatterjsonFormatterThe JSON formatter used to format the JSON string when log a JSON string.intlogLevelThe log level, the logs below of which would not be printed.intstackTraceDepthThe number of stack trace elements we should log when logging with stack trace, 0 if no limitation.StackTraceFormatterstackTraceFormatterThe stack trace formatter used to format the stack trace when logging.java.lang.StringstackTraceOriginThe 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.StringtagThe tag string.ThreadFormatterthreadFormatterThe thread formatter used to format the thread when logging.ThrowableFormatterthrowableFormatterThe throwable formatter used to format the throwable when log a message with throwable.booleanwithBorderWhether we should log with border.booleanwithStackTraceWhether we should log with stack trace.booleanwithThreadWhether we should log with thread info.XmlFormatterxmlFormatterThe XML formatter used to format the XML string when log a XML string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ObjectFormatter<? super T>getObjectFormatter(T object)GetObjectFormatterfor specific object.
-
-
-
Field Detail
-
logLevel
public final int logLevel
The log level, the logs below of which would not be printed.
-
tag
public final java.lang.String tag
The tag string.
-
withThread
public final boolean withThread
Whether we should log with thread info.
-
withStackTrace
public final boolean withStackTrace
Whether we should log with stack trace.
-
stackTraceOrigin
public final 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.".It is mostly used when you are using a logger wrapper.
- Since:
- 1.4.0
-
stackTraceDepth
public final int stackTraceDepth
The number of stack trace elements we should log when logging with stack trace, 0 if no limitation.
-
withBorder
public final boolean withBorder
Whether we should log with border.
-
jsonFormatter
public final JsonFormatter jsonFormatter
The JSON formatter used to format the JSON string when log a JSON string.
-
xmlFormatter
public final XmlFormatter xmlFormatter
The XML formatter used to format the XML string when log a XML string.
-
throwableFormatter
public final ThrowableFormatter throwableFormatter
The throwable formatter used to format the throwable when log a message with throwable.
-
threadFormatter
public final ThreadFormatter threadFormatter
The thread formatter used to format the thread when logging.
-
stackTraceFormatter
public final StackTraceFormatter stackTraceFormatter
The stack trace formatter used to format the stack trace when logging.
-
borderFormatter
public final BorderFormatter borderFormatter
The border formatter used to format the border when logging.
-
interceptors
public final java.util.List<Interceptor> interceptors
The interceptors, used to intercept the log when logging.- Since:
- 1.3.0
-
-
Method Detail
-
getObjectFormatter
public <T> ObjectFormatter<? super T> getObjectFormatter(T object)
GetObjectFormatterfor specific object.- Type Parameters:
T- the type of object- Parameters:
object- the object- Returns:
- the object formatter for the object, or null if not found
- Since:
- 1.1.0
-
-