Class FallbackLogFactory


  • public class FallbackLogFactory
    extends Object
    This factory creates the fallback strategy when Pax Logging Service is not (yet) available. This class is not part of pax-logging-api, it's in package that's supposed to be Private-Packaged by pax-logging backends. This special care has to be taken when dealing with singletons that can be produced by this factory. The singleton is implemented for FileServiceLog which is a default/fallback PaxLogger that writes to single FileOutputStream.
    • Constructor Detail

      • FallbackLogFactory

        public FallbackLogFactory()
    • Method Detail

      • createFallbackLog

        public static PaxLogger createFallbackLog​(org.osgi.framework.Bundle requestingBundle,
                                                  String categoryName)
        Create PaxLogger that doesn't delegate to logger from specific PaxLoggingService.
        Parameters:
        requestingBundle - a bundle requesting fallback logger that'll be used when we can't detect better one
        categoryName -
        Returns:
      • cleanup

        public static void cleanup()
        Because FallbackLogFactory may be Private-Packaged in all the backends (and in pax-logging-api too), each bundle has to call cleanup() in it's BundleActivator.stop(BundleContext).