In log4j etymology, Appenders are destinations where logs are written. Appenders have no control over formatting; this is controlled by the Layout.
The most basic appenders write logs to the console or to a file; these are described below.
For implementing your own appenders, see Details.
Usage
console_appender(layout = default_log_layout())
file_appender(file, append = TRUE, layout = default_log_layout())Arguments
- layout
A layout function taking a
levelparameter and additional arguments corresponding to the message. Seelayouts().- file
The file to write messages to.
- append
When
TRUE, the file is not truncated when opening for the first time.
Value
An appender: a function with the interface function(level, ...)
that writes its arguments to a destination and returns invisible(NULL).
Details
Appenders are implemented as functions with the interface function(level, ...). These functions are expected to write their arguments to a destination
and return invisible(NULL).