public class SyslogParser extends Object implements Closeable
| Constructor and Description |
|---|
SyslogParser() |
SyslogParser(InputStream in)
Construct a new Syslog protocol parser.
|
SyslogParser(InputStream in,
boolean parseTag,
Charset encoding)
Construct a new Syslog protocol parser.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Free the resources used by this parser.
|
List<Object> |
readEvent()
Read the next Syslog message from the stream.
|
void |
setInputStream(InputStream in) |
public SyslogParser()
public SyslogParser(InputStream in)
public SyslogParser(InputStream in, boolean parseTag, Charset encoding)
in - the stream to read data from. The InputStream#read()
function is heavily used, so make sure it is buffered.parseTag - true to parse the "tag[pid]:", false to leave it as
part of the message body.encoding - the encoding to use for various string conversions,
most notably the hostname.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic List<Object> readEvent() throws IOException
IOException - if the underlying stream fails, or unexpected
bytes are seen.public void setInputStream(InputStream in)
Copyright © 2024 The Apache Software Foundation. All rights reserved.