Class DebugListener

  • All Implemented Interfaces:
    jakarta.servlet.ServletContextListener, java.util.EventListener, LifeCycle

    @ManagedObject("Debug Listener")
    public class DebugListener
    extends AbstractLifeCycle
    implements jakarta.servlet.ServletContextListener
    A Context Listener that produces additional debug. This listener if added to a ContextHandler, will produce additional debug information to either/or a specific log stream or the standard debug log. The events produced by ServletContextListener, ServletRequestListener, AsyncListener and ContextHandler.ContextScopeListener are logged.
    • Constructor Detail

      • DebugListener

        public DebugListener()
      • DebugListener

        public DebugListener​(@Name("renameThread")
                             boolean renameThread,
                             @Name("showHeaders")
                             boolean showHeaders,
                             @Name("dumpContext")
                             boolean dumpContext)
      • DebugListener

        public DebugListener​(@Name("outputStream")
                             java.io.OutputStream out,
                             @Name("renameThread")
                             boolean renameThread,
                             @Name("showHeaders")
                             boolean showHeaders,
                             @Name("dumpContext")
                             boolean dumpContext)
    • Method Detail

      • isRenameThread

        @ManagedAttribute("Rename thread within context scope")
        public boolean isRenameThread()
      • setRenameThread

        public void setRenameThread​(boolean renameThread)
      • isShowHeaders

        @ManagedAttribute("Show request headers")
        public boolean isShowHeaders()
      • setShowHeaders

        public void setShowHeaders​(boolean showHeaders)
      • isDumpContext

        @ManagedAttribute("Dump contexts at start")
        public boolean isDumpContext()
      • setDumpContext

        public void setDumpContext​(boolean dumpContext)
      • contextInitialized

        public void contextInitialized​(jakarta.servlet.ServletContextEvent sce)
        Specified by:
        contextInitialized in interface jakarta.servlet.ServletContextListener
      • contextDestroyed

        public void contextDestroyed​(jakarta.servlet.ServletContextEvent sce)
        Specified by:
        contextDestroyed in interface jakarta.servlet.ServletContextListener
      • findContextName

        protected java.lang.String findContextName​(jakarta.servlet.ServletContext context)
      • findRequestName

        protected java.lang.String findRequestName​(jakarta.servlet.ServletRequest request)
      • log

        protected void log​(java.lang.String format,
                           java.lang.Object... arg)