On Tue, Apr 19, 2016 at 7:50 PM, Harrison Mebane <harr...@svds.com> wrote:
I am having trouble getting log output from Jupyter instances spawned from Jupyterhub. I can see the instance logs in the console if I run Jupyterhub in the foreground, but if I try to write to a file (even with open permissions), I only get the Jupyterhub process logs, and not the single-user instance logs. I am using the default spawner, and I have tried specifying both c.JupyterHub.extra_log_file in the config file and --log-file on the command line invocation. Both have the same result -- Jupyterhub process logs, but no instance logs.Do I need to use a different spawner, or is there another option that I'm missing?
That’s correct, setting JupyterHub.extra_log_file only redirects the logs of JupyterHub itself. Capturing single-user logs will depend on what spawner you use. I would not recommend that anyone use JupyterHub.extra_log_file unless it is your goal to separate JupyterHub logs from everything else.
If you are using the simple local spawner, the best and simplest way to capture all of the logging output is by redirecting stderr of the top-level jupyterhub process. This will capture the stdout/stderr of all descendant processes, including the proxy and single-user servers.
If you are using supervisor, the config looks like this:
[jupyterhub]
command=/usr/local/bin/jupyterhub
redirect_stderr=true
stdout_logfile=/var/log/jupyterhub.log
In a regular shell, that would look like this:
jupyterhub &>> /path/to/jupyterhub.log
-MinRK
Here are the contents of my Jupyterhub config file:# Configuration file for jupyterhub.# Tell Jupyterhub where to put the cookie secret and database filec.JupyterHub.cookie_secret_file = '/srv/jupyterhub/cookie_secret'c.JupyterHub.db_url = '/srv/jupyterhub/jupyterhub.sqlite'# Set the Jupyterhub log file locationc.JupyterHub.extra_log_file = '/var/log/jupyterhub.log'# Set the log level by value or name.c.JupyterHub.log_level = 'DEBUG'# Enable debug-logging of the single-user serverc.Spawner.debug = True# Enable debug-logging of the single-user serverc.LocalProcessSpawner.debug = TrueThank you!--Harrison
--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/92fa7d42-76b7-448b-bad0-fe883474ec74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.