Log to a rotating file

Log to a rotating file

Details

An extension of AppenderFile that rotates logfiles based on certain conditions. Please refer to the documentation of rotor::rotate() for the meanings of the extra arguments

Super classes

lgr::Filterable -> lgr::Appender -> lgr::AppenderFile -> AppenderFileRotating

Active bindings

backups

A data.frame containing information on path, file size, etc... on the available backups of file.

Methods

Inherited methods


Method new()

Usage

AppenderFileRotating$new(
  file,
  threshold = NA_integer_,
  layout = LayoutFormat$new(),
  filters = NULL,
  size = Inf,
  max_backups = Inf,
  compression = FALSE,
  backup_dir = dirname(file),
  create_file = NULL
)

Arguments

size, max_backups, compression, backup_dir, fmt

see rotor::rotate() for the meaning of these arguments. Note that fmt corresponds to format and backup_dir to dir.


Method append()

Usage

AppenderFileRotating$append(event)


Method rotate()

Usage

AppenderFileRotating$rotate(force = FALSE)


Method prune()

Usage

AppenderFileRotating$prune(max_backups = self$max_backups)


Method set_file()

Usage

AppenderFileRotating$set_file(file)


Method set_size()

Usage

AppenderFileRotating$set_size(x)


Method set_max_backups()

Usage

AppenderFileRotating$set_max_backups(x)


Method set_compression()

Usage

AppenderFileRotating$set_compression(x)


Method set_create_file()

Usage

AppenderFileRotating$set_create_file(x)


Method set_backup_dir()

Usage

AppenderFileRotating$set_backup_dir(x)


Method format()

Usage

AppenderFileRotating$format(color = false, ...)


Method clone()

The objects of this class are cloneable with this method.

Usage

AppenderFileRotating$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.