Access the error log on a brilliant server deployed to an AWS instance

I have a brilliant app that works fine on my local machine in RStudio. I ran an instance of AWS EC2 Ubuntu and installed R and a brilliant server on it. When I access the application through the browser, the application crashes at an (apparently) arbitrary point.

Where can I access the R console log to be able to debug code? There is no file in / var / log / shiny -server. In addition, the console in the browser simply states:

The application unexpectedly quit.

Diagnostic information is confidential. Please contact your system administrator for permission if you need to check the R logs.

I tried working with options(shiny.sanitize.errors = FALSE) no avail.

+5
source share
2 answers

I have found a solution. One should add sanitize_errors false; on shiny-server.conf, and then restart the shiny server. The error log is then displayed in the browser console.

+6
source

To view the logs:

Add the following line to your ui.R | server.R | app.R

 options(shiny.sanitize.errors = FALSE) 

Edit your brilliant server .conf file:

 sudo nano /etc/shiny-server/shiny-server.conf 

add this line after "run_as" (don't forget the ";" at the end)

preserve_logs true;

Note 1: You may need to add this preserve_log file to make the brilliant server save logs to files. (Remember to remove this option after a debugging session. Shiny will start creating logs even for successful application sessions, and this can generate LOTS log files)

Go to the log path:

 $ cd /var/log/shiny-server/ 

Check the logs and see what happens

 $ nano appName-shinyuser-yyyymmdd-hhmmss-41509.log 

In my case, the problem was just a missing package.

+2
source

All Articles