Description Usage Arguments Details Examples
Truncates the log file to the line count provided as rotate_lines
.
1 | rotate_logs(rotate_lines = 1e+05, logfile)
|
rotate_lines |
The number of log entries to keep in the logfile. Defaults to 100,000. |
logfile |
Log file to truncate. Defaults to the currently-configured log file. |
loggit
makes no assumptions nor enforcement of calling this function; that
is to say, the onus of log rotation is up to the developer. You
1 2 3 4 5 6 7 8 9 10 11 | # Truncate "default" log file to 100 lines
set_logfile()
for (i in 1:150) {loggit("INFO", i, echo = FALSE)}
rotate_logs(100)
# Truncate a different log file to 250 lines
another_log <- file.path(tempdir(), "another.log")
set_logfile(another_log)
for (i in 1:300) {loggit("INFO", i, echo = FALSE)}
set_logfile() # clears pointer to other log file
rotate_logs(250, another_log)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.