cubicweb/pyramid/bwcompat.py
changeset 12741 90348f847b4b
parent 12355 c703dc95c82e
child 12764 fb97669efcaa
--- a/cubicweb/pyramid/bwcompat.py	Wed Aug 21 04:52:08 2019 +0200
+++ b/cubicweb/pyramid/bwcompat.py	Wed Jun 12 19:58:00 2019 +0200
@@ -21,6 +21,7 @@
 """Backward compatibility layer for CubicWeb to run as a Pyramid application."""
 
 import sys
+import inspect
 import logging
 
 from pyramid import security
@@ -88,7 +89,12 @@
                     try:
                         controller = vreg['controllers'].select(
                             ctrlid, req, appli=self.appli)
+                        log.info("REQUEST [%s] '%s' selected controller %s at %s:%s",
+                                 ctrlid, req.path, controller,
+                                 inspect.getsourcefile(controller.__class__),
+                                 inspect.getsourcelines(controller.__class__)[1])
                     except cubicweb.NoSelectableObject:
+                        log.warn("WARNING '%s' unauthorized request", req.path)
                         raise httpexceptions.HTTPUnauthorized(
                             req._('not authorized'))