Abstract Class for Layouts
Abstract Class for Layouts
Appenders pass LogEvents to a Layout which formats it for
output. For the Layouts included in lgr that means turning the LogEvent
into a character
string.
For each Appender exist one more more possible Layouts, but not every Layout
will work with every Appender. See the package lgrExtra for examples
for Layouts that return different data types (such as data.frames
) and
Appenders that can handle them.
Layouts may have an additional $read(file, threshold, n)
method that returns
a character
vector, and/or an $parse(file)
method that
returns a data.frame
. These can be used by Appenders to $show()
methods
and $data
active bindings respectively (see source code of AppenderFile).
Other Layouts:
LayoutFormat
,
LayoutGlue
,
LayoutJson
format_event()
Format a log event
Function that the Layout uses to transform a LogEvent into something that an Appender can write to an output destination.
event
a LogEvent
toString()