Interface HttpAppLogger

  • All Superinterfaces:
    org.bedework.util.logging.Logged

    public interface HttpAppLogger
    extends org.bedework.util.logging.Logged
    Interface defining some logging methods for http applications.

    getLogEntry, logInfo, logRequest, logSessionCounts provide information for usage statistics of web applications.

    Author:
    Mike Douglass douglm@rpi.edu
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  HttpAppLogger.LogEntry  
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void emitLogEntry​(HttpAppLogger.LogEntry entry)
      Emit the log entry
      default HttpAppLogger.LogEntry getLogEntry​(javax.servlet.http.HttpServletRequest request, String logname)
      Return a LogEntry containing the start of a log entry.
      String getLogPrefix​(javax.servlet.http.HttpServletRequest request)
      Get a prefix for the loggers.
      default String getSessionId​(javax.servlet.http.HttpServletRequest request)
      Get the session id for the loggers.
      default void logInfo​(javax.servlet.http.HttpServletRequest request, String logname, String info)
      Log some information.
      default void logRequest​(javax.servlet.http.HttpServletRequest request)
      Log the request - virtual domains can make it difficult to distinguish applications.
      default void logRequestOut​(javax.servlet.http.HttpServletRequest request)
      Log the request on the way out.
      default void logSessionCounts​(javax.servlet.http.HttpServletRequest request, boolean start, long sessionNum, long sessions)
      Log the session counters for applications that maintain them.
      • Methods inherited from interface org.bedework.util.logging.Logged

        audit, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogger, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, setLogLevel, trace, trace, warn
    • Method Detail

      • getLogEntry

        default HttpAppLogger.LogEntry getLogEntry​(javax.servlet.http.HttpServletRequest request,
                                                   String logname)
        Return a LogEntry containing the start of a log entry.
        Parameters:
        request - HttpServletRequest
        logname - String name for the log entry
        Returns:
        LogEntry containing prefix
      • logInfo

        default void logInfo​(javax.servlet.http.HttpServletRequest request,
                             String logname,
                             String info)
        Log some information.
        Parameters:
        request - HttpServletRequest
        logname - String name for the log entry
        info - String information to log
      • logRequest

        default void logRequest​(javax.servlet.http.HttpServletRequest request)
                         throws Throwable
        Log the request - virtual domains can make it difficult to distinguish applications.
        Parameters:
        request - HttpServletRequest
        Throws:
        Throwable - on error
      • logRequestOut

        default void logRequestOut​(javax.servlet.http.HttpServletRequest request)
                            throws Throwable
        Log the request on the way out.
        Parameters:
        request - HttpServletRequest
        Throws:
        Throwable - on error
      • logSessionCounts

        default void logSessionCounts​(javax.servlet.http.HttpServletRequest request,
                                      boolean start,
                                      long sessionNum,
                                      long sessions)
        Log the session counters for applications that maintain them.
        Parameters:
        request - HttpServletRequest
        start - true for session start
        sessionNum - long number of session
        sessions - long number of concurrent sessions
      • getLogPrefix

        String getLogPrefix​(javax.servlet.http.HttpServletRequest request)
        Get a prefix for the loggers.
        Parameters:
        request - HttpServletRequest
        Returns:
        String log prefix
      • getSessionId

        default String getSessionId​(javax.servlet.http.HttpServletRequest request)
        Get the session id for the loggers.
        Parameters:
        request - the incoming request to log
        Returns:
        String session id