Debug output in Shiny Server

2,250 views
Skip to first unread message

Dieter Menne

unread,
May 28, 2014, 12:40:05 PM5/28/14
to shiny-...@googlegroups.com
I have a bug in my application that does not turn up with runApp(), but only when shiny is running in the shiny server (Ubuntu).

How do I use print/cat etc in Shiny server? I could not see any output in Firebug windows.

Dieter

Joe Cheng

unread,
May 28, 2014, 4:36:25 PM5/28/14
to Dieter Menne, shiny-...@googlegroups.com
It's not great but I usually do something like this:

cat(..., file=stderr())

You'll then have to track down the log file where the application is sending its standard-error. In a stock shiny server deployment I believe this is in /var/log/shiny-server. Each R process gets a different file. (If an R process exits gracefully, its log file is automatically deleted; if it exits with a non-zero exit code then the log file is kept.)

You can do "tail -f path-to-logfile" on the server to see the output in realtime.

It would probably be a good idea to make it very simple to log to the JavaScript console though. Maybe like a session$log().


--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dieter Menne

unread,
May 29, 2014, 4:14:56 AM5/29/14
to shiny-...@googlegroups.com, Dieter Menne
Thanks, I had used that method, but I thought there must be an easier way via Browser.

As a side note: I have tracked the error down, and it is a problem of some Umlaut (äü) that are treated correctly when running in runApp, and crash lead to an error in Server; looks like some iconv-magic is required. Which brings me back to the nasty

https://groups.google.com/forum/?fromgroups#!searchin/shiny-discuss/umlaut/shiny-discuss/4v5WcCdeGBg/N2dCdiZ_pC8J

still unresolved.

Dieter
Reply all
Reply to author
Forward
0 new messages