Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dreamRs/shinylogs
Logs for Shiny apps
https://github.com/dreamRs/shinylogs
logs r shiny shinyapps
Last synced: about 1 month ago
JSON representation
Logs for Shiny apps
- Host: GitHub
- URL: https://github.com/dreamRs/shinylogs
- Owner: dreamRs
- Created: 2018-12-14T10:36:28.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-10T16:06:19.000Z (about 1 year ago)
- Last Synced: 2024-05-09T22:15:31.931Z (8 months ago)
- Topics: logs, r, shiny, shinyapps
- Language: R
- Homepage: https://dreamrs.github.io/shinylogs/
- Size: 3.71 MB
- Stars: 95
- Watchers: 3
- Forks: 13
- Open Issues: 9
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
- jimsghstars - dreamRs/shinylogs - Logs for Shiny apps (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# 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.
[![version](https://www.r-pkg.org/badges/version/shinylogs)](https://CRAN.R-project.org/package=shinylogs)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![Project Status: Active The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Codecov test coverage](https://codecov.io/gh/dreamRs/shinylogs/branch/master/graph/badge.svg)](https://app.codecov.io/gh/dreamRs/shinylogs?branch=master)
[![R-CMD-check](https://github.com/dreamRs/shinylogs/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dreamRs/shinylogs/actions/workflows/R-CMD-check.yaml)## Installation
You can install the released version of shinylogs from [CRAN](https://CRAN.R-project.org/package=shinylogs) with:
```r
install.packages("shinylogs")
```And the development version from [GitHub](https://github.com/dreamRs/shinylogs) with:
```r
# 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:
```{r example, eval=FALSE}
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 applicationSee the vignette for more details (` ?vignette("shinylogs")`) or the [online version](https://dreamrs.github.io/shinylogs/articles/shinylogs.html).
## 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:
```{r, echo=FALSE}
knitr::include_graphics("man/figures/connections-apps.png")
```Number of connections over time :
```{r, echo=FALSE}
knitr::include_graphics("man/figures/connections-day.png")
```Which tabs (from sidebar in {shinydashboard}) in [shinyWidgets](https://github.com/dreamRs/shinyWidgets) gallery are the most seen :
```{r, echo=FALSE}
knitr::include_graphics("man/figures/shinyWidgets-tabs.png")
```User-agent is recorded per connection and can be parsed with [uaparserjs](https://github.com/hrbrmstr/uaparserjs) :
(unique users are not registered as we use the open source version of shiny-server)```{r, echo=FALSE}
knitr::include_graphics("man/figures/ua-family.png")
knitr::include_graphics("man/figures/ua-os.png")
```## Development
This package use [{packer}](https://github.com/JohnCoene/packer) to manage JavaScript assets, see packer's [documentation](https://packer.john-coene.com/#/) for more.
Install nodes modules with:
```r
packer::npm_install()
```Modify `srcjs/exts/shinylogs.js`, then run:
```r
packer::bundle()
```Re-install R package and try `track_usage()` function.