Overview
Shiny Server error logs can be found at these locations for the server and the applications respectively:
/var/log/shiny-server.log
/var/log/shiny-server/*.log
Server Error Log
All information related to Shiny Server itself, rather than a particular Shiny application, is logged in the global system log stored in
/var/log/shiny-server.log
. This log should be checked often to ensure Shiny Server is performing as expected. Any errors and warnings that Shiny Server needs to communicate will be written here.
If logrotate
is available when Shiny Server is installed, a logrotate
configuration will be installed. The default configuration is to rotate the logfile when it exceeds 1MB in size. The old log file will be compressed and stored alongside the original log file with a .1.gz
extension (then .2.gz
, etc.). Up to twelve archived log files will be maintained; upon the thirteenth log rotation, the oldest log file will be deleted.
Application Error Logs
Error logs are created for each R Shiny process separately. For locations
configured to use user_apps
or user_dirs
, these logs are created in each user's ~/ShinyApps/log/
directory. For location
s configured with app_dir
or site_dir
, the directory in which these logs are created is managed by the log_dir
setting, which can be specified globally, for a particular server
, or for a particular location
. By default, these logs will be located at /var/log/shiny-server/
. To change the directory at the location
level, the log_dir
can be specified in the following way:
location / {
log_dir /var/log/shiny-server/;
}
The log files will be created in the following format:
<application directory name>-YYYMMDD-HHmmss-<port number or socket ID>.log
A log file will be created for each R process when it is started. However, if a process closes successfully, the error log associated with that process will be automatically deleted. The only error log files that will remain on disk are those associated with R processes that did not exit as expected.
You can override this behavior using the preserve_logs
configuration option. If you set preserve_logs true;
in your configuration file, Shiny Server will never delete the logs from your R processes, regardless of their exit code. Be aware that this will cause log files to accumulate very quickly on a busy server. This setting is only recommended for debugging purposes; if it were to be enabled on a production server, you would need to pay close attention to the rotation and archiving of logs to prevent your file system becoming overwhelmed with log files.
References
Shiny Server Error Log for more information in the Shiny Server Pro administrator's guide.
Shiny Application Error Logs for more information in the Shiny Server Pro administrator's guide.
Debugging Shiny Applications for an overview of how to debug shiny applications.
Troubleshooting Applications in Shiny Server Pro for Disconnected from server messages.
Comments