public class JsonLayout extends JsonLayoutBase<ch.qos.logback.access.spi.IAccessEvent>
jsonMap from a
source IAccessEvent with the following keys/value pairs:
| Key | Value | Notes | Enabled by default? |
|---|---|---|---|
timestamp |
String value of IAccessEvent. |
By default, the value is not formatted; it is simply String.valueOf(timestamp). To format
the string using a SimpleDateFormat, set the timestampFormat
property with the corresponding SimpleDateFormat string, for example, yyyy-MM-dd HH:mm:ss.SSS |
true |
remoteAddress |
IAccessEvent. |
Internet Protocol (IP) address of the client or last proxy that sent the request. | true |
remoteUser |
IAccessEvent. |
true | |
requestTime |
String value of IAccessEvent. |
The time elapsed between receiving the request and logging it. By default, the value is formatted as s.SSS |
true |
uri |
IAccessEvent. |
true | |
status |
String value of IAccessEvent. |
true | |
method |
IAccessEvent. |
true | |
protocol |
IAccessEvent. |
true | |
contentLength |
String value of IAccessEvent. |
true | |
url |
IAccessEvent. |
false | |
remoteHost |
IAccessEvent. |
Fully qualified name of the client or the last proxy that sent the request. | true |
serverName |
IAccessEvent. |
Name of the server to which the request was sent. | true |
headers |
IAccessEvent. |
This value is a Map<String,String>. |
true |
params |
IAccessEvent. |
This value is a Map<String,String>. |
true |
port |
String value of IAccessEvent. |
false | |
requestContent |
IAccessEvent. |
false | |
responseContent |
IAccessEvent. |
false |
appendLineSeparator, CONTENT_TYPE, includeTimestamp, jsonFormatter, timestampFormat, timestampFormatTimezoneId| Constructor and Description |
|---|
JsonLayout() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addInt(String key,
boolean field,
int intValue,
Map<String,Object> map) |
protected void |
addRequestTime(long requestTime,
Map<String,Object> map) |
boolean |
isIncludeContentLength() |
boolean |
isIncludeLocalPort() |
boolean |
isIncludeMethod() |
boolean |
isIncludeProtocol() |
boolean |
isIncludeRemoteAddr() |
boolean |
isIncludeRemoteHost() |
boolean |
isIncludeRemoteUser() |
boolean |
isIncludeRequestContent() |
boolean |
isIncludeRequestHeader() |
boolean |
isIncludeRequestParameter() |
boolean |
isIncludeRequestTime() |
boolean |
isIncludeRequestURI() |
boolean |
isIncludeRequestURL() |
boolean |
isIncludeResponseContent() |
boolean |
isIncludeServerName() |
boolean |
isIncludeStatusCode() |
void |
setIncludeContentLength(boolean includeContentLength) |
void |
setIncludeLocalPort(boolean includeLocalPort) |
void |
setIncludeMethod(boolean includeMethod) |
void |
setIncludeProtocol(boolean includeProtocol) |
void |
setIncludeRemoteAddr(boolean includeRemoteAddr) |
void |
setIncludeRemoteHost(boolean includeRemoteHost) |
void |
setIncludeRemoteUser(boolean includeRemoteUser) |
void |
setIncludeRequestContent(boolean includeRequestContent) |
void |
setIncludeRequestHeader(boolean includeRequestHeader) |
void |
setIncludeRequestParameter(boolean includeRequestParameter) |
void |
setIncludeRequestTime(boolean includeRequestTime) |
void |
setIncludeRequestURI(boolean includeRequestURI) |
void |
setIncludeRequestURL(boolean includeRequestURL) |
void |
setIncludeResponseContent(boolean includeResponseContent) |
void |
setIncludeServerName(boolean includeServerName) |
void |
setIncludeStatusCode(boolean includeStatusCode) |
protected Map |
toJsonMap(ch.qos.logback.access.spi.IAccessEvent event) |
add, addMap, addTimestamp, createDateFormat, doLayout, format, formatTimestamp, getContentType, getJsonFormatter, getTimestampFormat, getTimestampFormatTimezoneId, isAppendLineSeparator, isIncludeTimestamp, setAppendLineSeparator, setIncludeTimestamp, setJsonFormatter, setTimestampFormat, setTimestampFormatTimezoneIdgetContext, getFileFooter, getFileHeader, getPresentationFooter, getPresentationHeader, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader, start, stopaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getDeclaredOrigin, getStatusManagerpublic static final String TIMESTAMP_ATTR_NAME
public static final String REMOTEADDR_ATTR_NAME
public static final String REMOTEUSER_ATTR_NAME
public static final String REQUESTTIME_ATTR_NAME
public static final String REQUESTURI_ATTR_NAME
public static final String STATUSCODE_ATTR_NAME
public static final String METHOD_ATTR_NAME
public static final String PROTOCOL_ATTR_NAME
public static final String CONTENTLENGTH_ATTR_NAME
public static final String REQUESTURL_ATTR_NAME
public static final String REMOTEHOST_ATTR_NAME
public static final String SERVERNAME_ATTR_NAME
public static final String REQUESTHEADER_ATTR_NAME
public static final String REQUESTPARAMETER_ATTR_NAME
public static final String LOCALPORT_ATTR_NAME
public static final String REQUESTCONTENT_ATTR_NAME
public static final String RESPONSECONTENT_ATTR_NAME
protected boolean includeRemoteAddr
protected boolean includeRemoteUser
protected boolean includeRequestTime
protected boolean includeRequestURI
protected boolean includeStatusCode
protected boolean includeMethod
protected boolean includeProtocol
protected boolean includeContentLength
protected boolean includeRequestURL
protected boolean includeRemoteHost
protected boolean includeServerName
protected boolean includeRequestHeader
protected boolean includeRequestParameter
protected boolean includeLocalPort
protected boolean includeRequestContent
protected boolean includeResponseContent
protected Map toJsonMap(ch.qos.logback.access.spi.IAccessEvent event)
toJsonMap in class JsonLayoutBase<ch.qos.logback.access.spi.IAccessEvent>public boolean isIncludeRemoteAddr()
public void setIncludeRemoteAddr(boolean includeRemoteAddr)
public boolean isIncludeRemoteUser()
public void setIncludeRemoteUser(boolean includeRemoteUser)
public boolean isIncludeRequestTime()
public void setIncludeRequestTime(boolean includeRequestTime)
public boolean isIncludeRequestURI()
public void setIncludeRequestURI(boolean includeRequestURI)
public boolean isIncludeStatusCode()
public void setIncludeStatusCode(boolean includeStatusCode)
public boolean isIncludeMethod()
public void setIncludeMethod(boolean includeMethod)
public boolean isIncludeProtocol()
public void setIncludeProtocol(boolean includeProtocol)
public boolean isIncludeContentLength()
public void setIncludeContentLength(boolean includeContentLength)
public boolean isIncludeRequestURL()
public void setIncludeRequestURL(boolean includeRequestURL)
public boolean isIncludeRemoteHost()
public void setIncludeRemoteHost(boolean includeRemoteHost)
public boolean isIncludeServerName()
public void setIncludeServerName(boolean includeServerName)
public boolean isIncludeRequestHeader()
public void setIncludeRequestHeader(boolean includeRequestHeader)
public boolean isIncludeRequestParameter()
public void setIncludeRequestParameter(boolean includeRequestParameter)
public boolean isIncludeLocalPort()
public void setIncludeLocalPort(boolean includeLocalPort)
public boolean isIncludeRequestContent()
public void setIncludeRequestContent(boolean includeRequestContent)
public boolean isIncludeResponseContent()
public void setIncludeResponseContent(boolean includeResponseContent)
Copyright © 2012–2016. All rights reserved.