Class FastLogContextFactory

  • All Implemented Interfaces:
    org.apache.logging.log4j.spi.LoggerContextFactory

    public final class FastLogContextFactory
    extends java.lang.Object
    implements org.apache.logging.log4j.spi.LoggerContextFactory
    An alternate Log4j2 LoggerContextFactory implementation which returns loggers which can short-circuit debug and trace messages so that they may be disabled without incurring cost from filters installed within Log4j. This may be installed by specifying -Dlog4j2.loggerContextFactory=com.linkedin.alpini.log.FastLogContextFactory It should install a management mbean com.linkedin.alpini.log:type=FastLog which will allow enabling DEBUG/TRACE propagation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.logging.log4j.spi.LoggerContext getContext​(java.lang.String fqcn, java.lang.ClassLoader loader, java.lang.Object externalContext, boolean currentContext)  
      org.apache.logging.log4j.spi.LoggerContext getContext​(java.lang.String fqcn, java.lang.ClassLoader loader, java.lang.Object externalContext, boolean currentContext, java.net.URI configLocation, java.lang.String name)  
      FastLogMBean getManagementMBean()  
      void removeContext​(org.apache.logging.log4j.spi.LoggerContext context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.logging.log4j.spi.LoggerContextFactory

        hasContext, isClassLoaderDependent, shutdown
    • Constructor Detail

      • FastLogContextFactory

        public FastLogContextFactory​(@Nonnull
                                     org.apache.logging.log4j.spi.LoggerContextFactory factory)
      • FastLogContextFactory

        public FastLogContextFactory()
    • Method Detail

      • getManagementMBean

        public FastLogMBean getManagementMBean()
      • getContext

        public org.apache.logging.log4j.spi.LoggerContext getContext​(java.lang.String fqcn,
                                                                     java.lang.ClassLoader loader,
                                                                     java.lang.Object externalContext,
                                                                     boolean currentContext)
        Specified by:
        getContext in interface org.apache.logging.log4j.spi.LoggerContextFactory
      • getContext

        public org.apache.logging.log4j.spi.LoggerContext getContext​(java.lang.String fqcn,
                                                                     java.lang.ClassLoader loader,
                                                                     java.lang.Object externalContext,
                                                                     boolean currentContext,
                                                                     java.net.URI configLocation,
                                                                     java.lang.String name)
        Specified by:
        getContext in interface org.apache.logging.log4j.spi.LoggerContextFactory
      • removeContext

        public void removeContext​(org.apache.logging.log4j.spi.LoggerContext context)
        Specified by:
        removeContext in interface org.apache.logging.log4j.spi.LoggerContextFactory