mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 15:03:02 +00:00
Merge pull request #4475 from grios-stratio/fix/custom-debug-function
Allow setting custom log_function in tornado_settings in SingleUserServer
This commit is contained in:
@@ -617,7 +617,9 @@ class JupyterHubSingleUser(ExtensionApp):
|
||||
app.web_app.settings[
|
||||
"page_config_hook"
|
||||
] = app.identity_provider.page_config_hook
|
||||
app.web_app.settings["log_function"] = log_request
|
||||
# if the user has configured a log function in the tornado settings, do not override it
|
||||
if not 'log_function' in app.config.ServerApp.get('tornado_settings', {}):
|
||||
app.web_app.settings["log_function"] = log_request
|
||||
# add jupyterhub version header
|
||||
headers = app.web_app.settings.setdefault("headers", {})
|
||||
headers["X-JupyterHub-Version"] = __version__
|
||||
|
@@ -669,7 +669,8 @@ class SingleUserNotebookAppMixin(Configurable):
|
||||
# load the hub-related settings into the tornado settings dict
|
||||
self.init_hub_auth()
|
||||
s = self.tornado_settings
|
||||
s['log_function'] = log_request
|
||||
# if the user has configured a log function in the tornado settings, do not override it
|
||||
s.setdefault('log_function', log_request)
|
||||
s['user'] = self.user
|
||||
s['group'] = self.group
|
||||
s['hub_prefix'] = self.hub_prefix
|
||||
|
Reference in New Issue
Block a user