Getting useful logging information in shinyapps.io

Hi,

I have an app which when I deploy it, fails to run, and there is nothing useful in the logs to indicate what the problem is. My app is a shiny Rmarkdown document. I can reproduce the problem with this trivial file:

index.Rmd:


---
title: R Markdown
output: html_document
runtime: shiny
---

Here is a function that does not exist.

```{r}
badfunc()
```

When I run this locally (with rmarkdown::run() in the same directory as the .Rmd file, I get an informative error in the browser and the terminal.

If I deploy this app to shinyapps.io (with rsconnect::setAccountInfo(...) and rsconnect::deployApp(logLevel='verbose')) I get this in the browser:

Error: An error has occurred. Check your logs or contact the app author for clarification.

and this in the log in shinyapps.io:

2022-10-20T03:04:51.434791+00:00 shinyapps[7362061]: Container event from container-7307012: start
2022-10-20T03:07:12.287215+00:00 shinyapps[7362061]: Container event from container-7307015: start
2022-10-20T03:07:15.434762+00:00 shinyapps[7362061]: Container event from container-7307012: stop
2022-10-20T03:29:36.435454+00:00 shinyapps[7362061]: Container event from container-7307062: start
2022-10-20T03:29:40.287210+00:00 shinyapps[7362061]: Container event from container-7307015: stop

There is nothing in the log to give me any clue what has gone wrong.

This is a contrived example - my app is of course more complex. But it is an Rmarkdown document with a shiny runtime and it illustrates the problem that there is no way to debug the deployment.

Unlike this contrived example, my app runs fine on my local machine. So there is some issue which is specific to the shinyapps.io deployment that I am unable to debug because there is nothing helpful in the application log. Also, if I remove the call to badfunc(), the app runs fine.

Is there something I can do to get more helpful information in the logs?

Thanks.

1 Like