Log to a time-stamped rotating file
Log to a time-stamped rotating file
lgr::Filterable
-> lgr::Appender
-> lgr::AppenderFile
-> lgr::AppenderFileRotating
-> AppenderFileRotating
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.
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()
new()
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
)
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
.
rotate()
AppenderFileRotatingTime$rotate(force = FALSE, now = Sys.time())
set_age()
AppenderFileRotatingTime$set_age(x)
set_fmt()
AppenderFileRotatingTime$set_fmt(x)
set_overwrite()
AppenderFileRotatingTime$set_overwrite(x)
set_cache_backups()
set the cache_backups
flag.
AppenderFileRotatingTime$set_cache_backups(x)
x
a logical
scalar
format()
AppenderFileRotatingTime$format(color = FALSE, ...)
clone()
The objects of this class are cloneable with this method.
AppenderFileRotatingTime$clone(deep = FALSE)
deep
Whether to make a deep clone.
AppenderFileRotatingDate, AppenderFileRotating, rotor::rotate()
Other Appenders:
AppenderBuffer
,
AppenderConsole
,
AppenderFileRotatingDate
,
AppenderFileRotating
,
AppenderFile
,
AppenderTable
,
Appender