Logging tool for Shiny applications: record inputs or outputs changes, and infos about user’s session. All recording is done client-side to not slow down the application and occupy the server.
Installation
You can install the released version of shinylogs fromCRAN with:
install.packages("shinylogs")
And the development version fromGitHub with:
# install.packages("remotes")remotes::install_github("dreamRs/shinylogs")
Usage
Call the main functiontrack_usage
in server part of application, and specify where to write logs:
library(shinylogs)track_usage(storage_mode=store_json(path="logs/"))
The function will record :
- inputs : each time an input change, name, timestamp and value will be saved
- errors : errors propagated through outputs
- outputs : each time an output is re-generated
- session : informations about user’s browser and the application
See the vignette for more details (?vignette("shinylogs")
) or theonline version.
Examples
Some example of what is recorded with logs from applications available on our Shiny-Server:http://shinyapps.dreamrs.fr/
Number of connections per applications:
Number of connections over time :
Which tabs (from sidebar in {shinydashboard}) inshinyWidgets gallery are the most seen :
User-agent is recorded per connection and can be parsed withuaparserjs : (unique users are not registered as we use the open source version of shiny-server)
Development
This package use{packer} to manage JavaScript assets, see packer’sdocumentation for more.
Install nodes modules with:
packer::npm_install()
Modifysrcjs/exts/shinylogs.js
, then run:
packer::bundle()
Re-install R package and trytrack_usage()
function.