Interface ThreadContextPopulator

  • All Superinterfaces:
    org.springframework.beans.factory.InitializingBean
    All Known Implementing Classes:
    BuildInfoThreadContextPopulator, UserDetailsThreadContextPopulator

    public interface ThreadContextPopulator
    extends org.springframework.beans.factory.InitializingBean
    Interface for populating the Log4j ThreadContext with custom information.

    Each populator implementation is responsible for populating a key. It may be done immediately in populate() or at a later time.

    Author:
    poirigui
    • Field Detail

    • Method Detail

      • getKey

        String getKey()
        Key in the ThreadContext this populator is responsible for.
      • populate

        void populate()
        Populate the ThreadContext.

        This is called when the bean is initialized as per InitializingBean.afterPropertiesSet().

      • afterPropertiesSet

        default void afterPropertiesSet()
                                 throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception