public class TraceRecordBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
static TraceRecordBuilder |
build(TraceRecord record)
Setup the time stamp to now and create a new TraceRecordBuilder and Thread to current thread
name
|
static TraceRecordBuilder |
buildUnhandledException(Throwable exception,
String type,
String hashKey) |
TraceRecord |
getRecord() |
static TraceRecordBuilder |
newRecord()
Setup the time stamp to now and create a new TraceRecordBuilder and Thread to current thread
name
|
TraceRecordBuilder |
withException(Throwable exception)
Always add below exception information into TraceRecord
exception.msg
exception.callstack
exception.class
|
TraceRecordBuilder |
withHttpRequest(javax.servlet.http.HttpServletRequest request)
Always add below information into TraceRecord
request.path
request.parameters
request.cookies
request.content
|
TraceRecordBuilder |
withObject(String fieldName,
Number obj)
Add extend data into trace record, this basically doing: record.getExtendDatas().put(fieldName,
obj);
|
TraceRecordBuilder |
withObject(String fieldName,
Object obj)
Add extend data into trace record, this basically doing: record.getExtendDatas().put(fieldName,
toJson(obj));
|
TraceRecordBuilder |
withObject(String fieldName,
String obj)
Add extend data into trace record, this basically doing: record.getExtendDatas().put(fieldName,
obj);
|
TraceRecordBuilder |
withPayLoad(Object obj) |
TraceRecordBuilder |
withSimpleDateAsHashKey()
Setup HashKey as yyyy-MM-dd as of now
|
public static TraceRecordBuilder newRecord()
public static TraceRecordBuilder build(TraceRecord record)
public static TraceRecordBuilder buildUnhandledException(Throwable exception, String type, String hashKey)
public TraceRecord getRecord()
public TraceRecordBuilder withSimpleDateAsHashKey()
public TraceRecordBuilder withHttpRequest(javax.servlet.http.HttpServletRequest request)
public TraceRecordBuilder withException(Throwable exception)
public TraceRecordBuilder withObject(String fieldName, Object obj)
obj, - will convert to json before put into extend data, will use toString() if convert to
json failspublic TraceRecordBuilder withObject(String fieldName, Number obj)
public TraceRecordBuilder withObject(String fieldName, String obj)
public TraceRecordBuilder withPayLoad(Object obj)
Copyright © 2019. All rights reserved.