public class LogstashTcpEncoder extends LogstashEncoder
LogstashEncoder
adding encoding support and the new line
termination.
<ENCODING/> Define the used encoding as defined in Charset
. The default value is UTF-8
<NEWLINE/> Define the new line. Any defined character is used as new line terminator.
The set of pre-defined values are:
UNIX \n character (default).
NULL no new line.
SYSTEM operating system new line.
WINDOWS the \r\n combination
Constructor and Description |
---|
LogstashTcpEncoder() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
doEncode(ch.qos.logback.classic.spi.ILoggingEvent event) |
String |
getEncoding() |
String |
getNewLine() |
void |
setEncoding(String encoding)
Define the encoding used for sending the logs
|
void |
setNewLine(String newLine)
Define the new line.
|
addExcludeMdcKeyName, addIncludeMdcKeyName, getCustomFields, getExcludeMdcKeyNames, getFieldNames, getFormatter, getIncludeMdcKeyNames, getJsonFactoryDecorator, getJsonGeneratorDecorator, getShortenedLoggerNameLength, getThrowableConverter, getTimeZone, isEnableContextMap, isImmediateFlush, isIncludeCallerInfo, isIncludeContext, isIncludeMdc, setCustomFields, setEnableContextMap, setExcludeMdcKeyNames, setFieldNames, setImmediateFlush, setIncludeCallerInfo, setIncludeContext, setIncludeMdc, setIncludeMdcKeyNames, setJsonFactoryDecorator, setJsonGeneratorDecorator, setShortenedLoggerNameLength, setThrowableConverter, setTimeZone, start, stop
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
public void doEncode(ch.qos.logback.classic.spi.ILoggingEvent event) throws IOException
doEncode
in interface ch.qos.logback.core.encoder.Encoder<ch.qos.logback.classic.spi.ILoggingEvent>
doEncode
in class LogstashEncoder
IOException
public void close() throws IOException
close
in interface ch.qos.logback.core.encoder.Encoder<ch.qos.logback.classic.spi.ILoggingEvent>
close
in class LogstashEncoder
IOException
public void setEncoding(String encoding)
encoding
- the encoding to setpublic String getEncoding()
public void setNewLine(String newLine)
newLine
- the newLine to setpublic String getNewLine()
Copyright © 2015. All Rights Reserved.