diff options
Diffstat (limited to '')
-rw-r--r-- | src/pybind/mgr/dashboard/controllers/frontend_logging.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/controllers/frontend_logging.py b/src/pybind/mgr/dashboard/controllers/frontend_logging.py new file mode 100644 index 000000000..77372c655 --- /dev/null +++ b/src/pybind/mgr/dashboard/controllers/frontend_logging.py @@ -0,0 +1,15 @@ +from __future__ import absolute_import + +import logging + +from . import BaseController, Endpoint, UIRouter + +logger = logging.getLogger('frontend.error') + + +@UIRouter('/logging', secure=False) +class FrontendLogging(BaseController): + + @Endpoint('POST', path='js-error') + def jsError(self, url, message, stack=None): # noqa: N802 + logger.error('(%s): %s\n %s\n', url, message, stack) |