public class LogstashFormatter extends JsonFormatter
JSON formatter which adds the @version to
the generated JSON and overrides the timestamp key to @timestamp.
The default version is 1.
StructuredFormatter.Generator, StructuredFormatter.KeyDEFAULT_DATE_FORMAT| Constructor and Description |
|---|
LogstashFormatter()
Create the lostash formatter.
|
LogstashFormatter(Map<StructuredFormatter.Key,String> keyOverrides)
Create the logstash formatter overriding any default keys
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
before(StructuredFormatter.Generator generator,
org.jboss.logmanager.ExtLogRecord record)
Invoked before the structured data is added to the generator.
|
int |
getVersion()
Returns the version being used for the
@version property. |
void |
setVersion(int version)
Sets the version to use for the
@version property. |
createGenerator, isPrettyPrint, setPrettyPrintafter, format, getDateFormat, getKey, getMetaData, isAppendEndOfLine, isPrintDetails, setAppendEndOfLine, setDateFormat, setMetaData, setPrintDetailsformatMessage, getHead, getTailpublic LogstashFormatter()
public LogstashFormatter(Map<StructuredFormatter.Key,String> keyOverrides)
keyOverrides - the keys used to override the defaultsprotected void before(StructuredFormatter.Generator generator, org.jboss.logmanager.ExtLogRecord record) throws Exception
StructuredFormatterbefore in class StructuredFormattergenerator - the generator to userecord - the log recordExceptionpublic int getVersion()
@version property.public void setVersion(int version)
@version property.version - the version to useCopyright © 2015 JBoss by Red Hat. All rights reserved.