Learn R Programming

shinylogs

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 from CRAN with:

install.packages("shinylogs")

And the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("dreamRs/shinylogs")

Usage

Call the main function track_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 the online 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}) in shinyWidgets gallery are the most seen :

User-agent is recorded per connection and can be parsed with uaparserjs : (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’s documentation for more.

Install nodes modules with:

packer::npm_install()

Modify srcjs/exts/shinylogs.js, then run:

packer::bundle()

Re-install R package and try track_usage() function.

Copy Link

Version

Install

install.packages('shinylogs')

Monthly Downloads

818

Version

0.2.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Victor Perrier

Last Published

April 18th, 2022

Functions in shinylogs (0.2.1)

store_null

No storage on disk
store_googledrive

Use Google Drive as storage mode
read_rds_logs

Read a directory containing RDS logs
store_sqlite

Use SQLite database as storage mode
store_json

Use JSON files as storage mode
read_json_logs

Read a directory containing JSON logs
store_rds

Use RDS files as storage mode
store_custom

Use custom function to save logs
track_usage

Track usage of a Shiny app
use_tracking

Insert dependencies to track usage of a Shiny app