Class DebugListener

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.ee10.servlet.DebugListener
All Implemented Interfaces:
jakarta.servlet.ServletContextListener, 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 Details

    • DebugListener

      public DebugListener()
    • DebugListener

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

      public DebugListener(@Name("outputStream") OutputStream out, @Name("renameThread") boolean renameThread, @Name("showHeaders") boolean showHeaders, @Name("dumpContext") boolean dumpContext)
  • Method Details

    • 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 String findContextName(jakarta.servlet.ServletContext context)
    • findRequestName

      protected String findRequestName(ServletContextRequest request)
    • findRequestName

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

      protected void log(String format, Object... arg)