Class HttpLogging

java.lang.Object
org.springframework.http.HttpLogging

public abstract class HttpLogging extends Object
Holds the shared logger named "org.springframework.web.HttpLogging" for HTTP related logging when "org.springframework.http" is not enabled but "org.springframework.web" is.

That means "org.springframework.web" enables all web logging including from lower level packages such as "org.springframework.http" and modules such as codecs from "spring-core" when those are wrapped with EncoderHttpMessageWriter or DecoderHttpMessageReader.

To see logging from the primary class loggers simply enable logging for "org.springframework.http" and "org.springframework.codec".

Since:
5.1
Author:
Rossen Stoyanchev
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Log
    forLog(Log primaryLogger)
    Wrap the given primary logger with a composite logger that delegates to it or to the fallback logger "org.springframework.web.HttpLogging", if the primary is not enabled.
    static Log
    forLogName(Class<?> primaryLoggerClass)
    Create a primary logger for the given class and wrap it with a composite that delegates to it or to the fallback logger "org.springframework.web.HttpLogging", if the primary is not enabled.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HttpLogging

      public HttpLogging()
  • Method Details

    • forLogName

      public static Log forLogName(Class<?> primaryLoggerClass)
      Create a primary logger for the given class and wrap it with a composite that delegates to it or to the fallback logger "org.springframework.web.HttpLogging", if the primary is not enabled.
      Parameters:
      primaryLoggerClass - the class for the name of the primary logger
      Returns:
      the resulting composite logger
    • forLog

      public static Log forLog(Log primaryLogger)
      Wrap the given primary logger with a composite logger that delegates to it or to the fallback logger "org.springframework.web.HttpLogging", if the primary is not enabled.
      Parameters:
      primaryLogger - the primary logger to use
      Returns:
      the resulting composite logger