Class ProtonLoggerFactory

    • Constructor Detail

      • ProtonLoggerFactory

        public ProtonLoggerFactory()
    • Method Detail

      • getLoggerFactory

        public static ProtonLoggerFactory getLoggerFactory()
        Returns a ProtonLoggerFactory instance.

        The factory returned depends on the configuration and available logger implementations at the time this method is called. If a custom ProtonLoggerFactory is configured than that instance is returned, otherwise this class will attempt to find a factory for the slf4j logger library.

        Returns:
        a ProtonLoggerFactory that will be used by this library.
      • setLoggerFactory

        public static void setLoggerFactory​(ProtonLoggerFactory factory)
        Configure Proton with a custom ProtonLoggerFactory implementation which will be used by the Proton classes when logging library events.
        Parameters:
        factory - The ProtonLoggerFactory to use when loggers are requested.
        Throws:
        IllegalArgumentException - if the factory given is null.
      • getLogger

        public static ProtonLogger getLogger​(Class<?> clazz)
        Logger lookup based on the Class that will host the logger instance.
        Parameters:
        clazz - The Class that will host the logger instance being requested.
        Returns:
        a ProtonLogger that is tied to the given Class instance.
      • getLogger

        public static ProtonLogger getLogger​(String name)
        Logger lookup based on the given logger name that will host the logger instance.
        Parameters:
        name - The given name that will host the logger instance being requested.
        Returns:
        a ProtonLogger that is tied to the given logger name.
      • createLoggerWrapper

        protected abstract ProtonLogger createLoggerWrapper​(String name)