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_backupsTRUEorFALSE. IfTRUE(the default) the list of backups is cached, ifFALSEit is read from disk every time this appender triggers. Caching brings a significant speedup for checking whether to rotate or not based on theageof the last backup, but is only safe if there are no other programs/functions (except this appender) interacting with the backups.
Methods
Inherited methods
lgr::Filterable$add_filter()lgr::Filterable$filter()lgr::Filterable$remove_filter()lgr::Filterable$set_filters()lgr::Appender$set_layout()lgr::Appender$set_threshold()lgr::AppenderFile$show()lgr::AppenderFileRotating$append()lgr::AppenderFileRotating$prune()lgr::AppenderFileRotating$set_backup_dir()lgr::AppenderFileRotating$set_compression()lgr::AppenderFileRotating$set_create_file()lgr::AppenderFileRotating$set_file()lgr::AppenderFileRotating$set_max_backups()lgr::AppenderFileRotating$set_size()
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_backupssee
rotor::rotate_time()for the meaning of these arguments. Note thatfmtcorresponds toformatandbackup_dirtodir.
Method rotate()
Usage
AppenderFileRotatingTime$rotate(force = FALSE, now = Sys.time())