Log to a time-stamped rotating file

Log to a time-stamped rotating file

Super classes

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

Active bindings

cache_backups

TRUE or FALSE. If TRUE (the default) the list of backups is cached, if FALSE it is read from disk every time this appender triggers. Caching brings a significant speedup for checking whether to rotate or not based on the age of the last backup, but is only safe if there are no other programs/functions (except this appender) interacting with the backups.

Methods

Inherited methods


Method new()

Usage

AppenderFileRotatingTime$new(
  file,
  threshold = NA_integer_,
  layout = LayoutFormat$new(),
  filters = NULL,
  age = Inf,
  size = -1,
  max_backups = Inf,
  compression = FALSE,
  backup_dir = dirname(file),
  fmt = "%Y-%m-%d--%H-%M-%S",
  overwrite = FALSE,
  cache_backups = TRUE,
  create_file = NULL
)

Arguments

size, age, max_backups, compression, backup_dir, fmt, overwrite, cache_backups

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


Method rotate()

Usage

AppenderFileRotatingTime$rotate(force = FALSE, now = Sys.time())


Method set_age()

Usage

AppenderFileRotatingTime$set_age(x)


Method set_fmt()

Usage

AppenderFileRotatingTime$set_fmt(x)


Method set_overwrite()

Usage

AppenderFileRotatingTime$set_overwrite(x)


Method set_cache_backups()

set the cache_backups flag.

Usage

AppenderFileRotatingTime$set_cache_backups(x)

Arguments

x

a logical scalar


Method format()

Usage

AppenderFileRotatingTime$format(color = FALSE, ...)


Method clone()

The objects of this class are cloneable with this method.

Usage

AppenderFileRotatingTime$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.