Class DebugListener

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

    @ManagedObject("Debug Listener")
    public class DebugListener
    extends AbstractLifeCycle
    implements javax.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​(javax.servlet.ServletContextEvent sce)
        Specified by:
        contextInitialized in interface javax.servlet.ServletContextListener
      • contextDestroyed

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

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

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

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