Logging Json to STDOUT in Shiny Server

前端 未结 2 1597
悲哀的现实
悲哀的现实 2021-01-06 16:31

Docker containers can be configured on AWS to send anything that appears in stdout to be sent to a centralized logging service. This is a neat trick, if you pri

相关标签:
2条回答
  • 2021-01-06 16:43

    Unfortunately there is no way to log into stdout directly yet. However there is an approach to listen to the filesystem changes and print the logs properly.

    You can use e.g. xtail (which is available as a debian package) and listen to the server log folder changes. E.g.

    # start shiny server in detached mode
    exec shiny-server 2>&1 &
     # push the "real" application logs to stdout with xtail
    exec xtail /var/log/shiny-server/
    

    I also prepared this as a pull request to the rocker/shiny Docker image. Regardless of the result you can use it in your docker images.

    0 讨论(0)
  • 2021-01-06 17:01

    This is a supported feature as of Shiny Server 1.5.13. You can set the environment variable SHINY_LOG_STDERR=1 (for example, using an ENV statement in your Dockerfile) to enable this behavior.

    https://docs.rstudio.com/shiny-server/#logging-to-standard-error

    0 讨论(0)
提交回复
热议问题