I have a Docker container running a shiny app (Dockerfile here).
Shiny server logs are output to stdout and application logs are written to /var/log/shiny-server. I'm deploying this container to AWS Fargate and logging applications only display stdout which makes debugging an application when deployed challenging. I'd like to write the application logs to stdout.
I've tried a number of potential solutions:
I've tried the solution provided here, but have had no luck.. I added the
exec xtail /var/log/shiny-server/to myshiny-server.shas the last line in the file. App logs are not written tostdoutI noticed that writing application logs to
stdoutis now the default behavior inrocker/shiny, but as I'm usingrocker/verse:3.6.2(upgraded from 3.6.0 today) along withRUN export ADD=shiny, I don't think this is standard behavior for therocker/verse:3.6.2container with Shiny add-on. As a result, I don't get the default behavior out of the box.This issue on github suggests an alternative method of forcing application logging to
stdoutby way of an environment variableSHINY_LOG_STDERR=1set at runtime but I'm not Linux-savvy enough to know where that env variable needs to be set to be effective. I found this documentation from Shiny Server v1.5.13 which gave suggestions in which file to set the environment variable depending on Linux distro; however, the output from my container when I runcat /etc/os-releaseis:
which doesn't really line up with any of the distributions in the Shiny Server documentation, thus making the documentation unhelpful.
I tried adding adding the environment variable from the github issue above in the
docker runcommand, i.e.,docker run --rm -e SHINY_LOG_STDERR=1 -p 3838:3838 [my image]
as well as
docker run --rm -e APPLICATION_LOGS_TO_STDOUT=true -p 3838:3838 [my image]
and am still not getting the logs to stdout.
I must be missing something here. Can someone help me identify how to successfully get application logs to stdout successfully?
