Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Appender

Appenders


Description

Appenders are attached to Loggers and manage the output of the LogEvents to a destination - such as the console or a text file. An Appender has a single Layout that tells it how to format the LogEvent. For details please refer to the documentations of the specific Appenders.

Additional Appenders that support a wide range of output destinations - such as databases, email, push-notifications or Linux syslog - are available from the package lgrExtra.

NOTE: This is an abstract class. Abstract classes cannot be instantiated directly, but are exported for package developers that want to extend lgr - for example by creating their own Appenders or Layouts. Please refer to the see also section for actual implementations of this class.

Super class

lgr::Filterable -> Appender

Active bindings

destination

The output destination of the Appender in human-readable form. This is mainly used when printing information about the Appender itself.

Methods

Public methods


Method new()

Usage
Appender$new(layout = Layout$new(), threshold = NA_integer_)

Method append()

Process a LogEvent event. This method is usually not called by the user, but invoked by a Logger

Usage
Appender$append(event)

Method set_threshold()

Set the minimum log level that triggers this Appender. See threshold() for examples

Usage
Appender$set_threshold(level)
Arguments
level

character or integer scalar log level. See log_levels.


Method set_layout()

Set the Layout that this Appender will use for formatting LogEvents

Usage
Appender$set_layout(layout)

Method format()

Usage
Appender$format(color = FALSE, ...)

See Also

Other abstract classes: AppenderMemory, AppenderTable, Filterable


lgr

A Fully Featured Logging Framework

v0.4.2
MIT + file LICENSE
Authors
Stefan Fleck [aut, cre] (<https://orcid.org/0000-0003-3344-9851>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.