Skip to content

Commit 5c5c45f

Browse files
committed
Backport PR #1939: Add debug log for static file paths
Too often I'm trying to track down an errant extra static file path (like some javascript installed in some obscure place). This makes it easy to see exactly what is being served. Signed-off-by: Min RK <[email protected]>
1 parent ab79144 commit 5c5c45f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

notebook/base/handlers.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040

4141
sys_info = json.dumps(get_sys_info())
4242

43+
def log():
44+
if Application.initialized():
45+
return Application.instance().log
46+
else:
47+
return app_log
48+
4349
class AuthenticatedHandler(web.RequestHandler):
4450
"""A RequestHandler with an authenticated user."""
4551

@@ -152,10 +158,7 @@ def config(self):
152158
@property
153159
def log(self):
154160
"""use the IPython log by default, falling back on tornado's logger"""
155-
if Application.initialized():
156-
return Application.instance().log
157-
else:
158-
return app_log
161+
return log()
159162

160163
@property
161164
def jinja_template_vars(self):
@@ -547,6 +550,9 @@ def get_absolute_path(cls, roots, path):
547550
return ''
548551

549552
cls._static_paths[path] = abspath
553+
554+
555+
log().debug("Path %s served from %s"%(path, abspath))
550556
return abspath
551557

552558
def validate_absolute_path(self, root, absolute_path):

0 commit comments

Comments
 (0)