Class BaseLogEventWriter
java.lang.Object
org.jpos.util.BaseLogEventWriter
- All Implemented Interfaces:
LogEventWriter
- Direct Known Subclasses:
JsonlLogWriter, MappingLogEventWriter
Abstract class for LogEventWriter implementations.
Ensures that derived classes close the PrintStream since some of them
may wrap it in an outer stream.
Default write implementation is what is currently used by SimpleLogListener
with an additional null check on the passed in LogEvent.
- Since:
- 2.1.4
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for subclass instantiation. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the writer and releases any underlying resources.voidSets the print stream used for output.voidWrites a log event to the underlying output.
-
Constructor Details
-
BaseLogEventWriter
protected BaseLogEventWriter()Default constructor for subclass instantiation.
-
-
Method Details
-
setPrintStream
Description copied from interface:LogEventWriterSets the print stream used for output.- Specified by:
setPrintStreamin interfaceLogEventWriter- Parameters:
p- the destination stream
-
close
Description copied from interface:LogEventWriterCloses the writer and releases any underlying resources.- Specified by:
closein interfaceLogEventWriter
-
write
Description copied from interface:LogEventWriterWrites a log event to the underlying output.- Specified by:
writein interfaceLogEventWriter- Parameters:
ev- the log event to write
-