set_logging
should be used outside ui and server functions,
possibly in global.R
, to be used only once to define
where the logging should be done.
Events can be sent to R console, browser JavaScript console,
a eventlog file, or a database (or any combination of these).
By default logging is done to the R console and JavaScript console.
set_logging
also can be used
to define global event parameters - named objects passed to ...
that will be evaluated and added to lists of parameters of all events.
set_logging(r_console = TRUE, js_console = TRUE, file = FALSE, database = FALSE, ...)
r_console | A logical. Should events be logged into R console?
Default is |
---|---|
js_console | A logical. Should events be logged into browser
JavaScript console? Default is |
file | A logical or a character string.
Should events be logged to a file?
Default is |
database | A logical or a character string.
Should events be logged into a database?
Default is |
... | a set of named objects (usually of type character, numeric, or date) to be logged as parameters common to all events. |
set_logging
assigns to the parent frame a new environment
log_settings_global
for storing global event parameters.
If database = TRUE
additional database connection object
named log_db
is assigned to the parent frame as well.
Other setting up logging parameters functions: log_params
,
set_logging_session
if (interactive()) { set_logging(r_console = TRUE, js_console = FALSE, "param_1" = 1, "param_2" = "A") shiny::shinyApp( ui = shiny::fluidPage(), server = function(input, output) { set_logging_session() log_event("Event with global params") } ) }