From b734c331e46ce165bfd1a5cc4cd14842cf178572 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 22 Nov 2017 17:02:43 +0100 Subject: [PATCH] deprecate extra_log_file and add loud warning about discarding information this has been the cause of many debugging difficulties, when redirecting output seems to be a better option in ~all cases. --- jupyterhub/app.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/jupyterhub/app.py b/jupyterhub/app.py index cb9a2870..8fbec38b 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -710,12 +710,29 @@ class JupyterHub(Application): return "%(color)s[%(levelname)1.1s %(asctime)s.%(msecs).03d %(name)s %(module)s:%(lineno)d]%(end_color)s %(message)s" extra_log_file = Unicode( - help="""Send JupyterHub's logs to this file. + help=""" + DEPRECATED: use output redirection instead, e.g. - This will *only* include the logs of the Hub itself, - not the logs of the proxy or any single-user servers. + jupyterhub &>> /var/log/jupyterhub.log """ ).tag(config=True) + + @observe('extra_log_file') + def _log_file_changed(self, change): + if change.new: + self.log.warning(dedent(""" + extra_log_file is DEPRECATED in jupyterhub-0.8.2. + + extra_log_file only redirects logs of the Hub itself, + and will discard any other output, such as + that of subprocess spawners or the proxy. + + It is STRONGLY recommended that you redirect process + output instead, e.g. + + jupyterhub &>> '{}' + """.format(change.new))) + extra_log_handlers = List( Instance(logging.Handler), help="Extra log handlers to set on JupyterHub logger",