Class OSGIPaxLoggingManager

    • Constructor Detail

      • OSGIPaxLoggingManager

        public OSGIPaxLoggingManager​(org.osgi.framework.BundleContext context)
    • Method Detail

      • getLogger

        public PaxLogger getLogger​(String category,
                                   String fqcn)
        Description copied from interface: PaxLoggingManager
        Obtains a PaxLogger from this manager. Implementation delegates to PaxLoggingService or to fallback logger provider. This is the main method called inside any facade/bridge method (like SLF4J's LoggerFactory.getLogger()). fqcn parameter will be part of the returned PaxLogger to determine the location where logging method is invoked (by analyzing stack/class trace). Each PaxLogger has associated Bundle, but fqcn won't be used to determine the bundle. Bundle is determined statically when obtaining the logger as first bundle that's not pax-logging-api and represents a bundle that created the logger - not a place where this logger is used to log messages. Note that for java.util.logging, the logger is not directly obtained by "client" code, but rather in pax-logging specific Handler.
        Specified by:
        getLogger in interface PaxLoggingManager
        Parameters:
        category - just name of the logger
        fqcn - fully qualified name for pax-logging-specific factory-like class to make it easy to mark where (in the stack trace) user code calls logging code. It doesn't always make sense - mainly in dynamic scenarios where logging is invoked via LogService and not through concrete logger object
        Returns:
      • getLogger

        public PaxLogger getLogger​(org.osgi.framework.Bundle bundle,
                                   String category,
                                   String fqcn)
        Description copied from interface: PaxLoggingManager
        Obtains a PaxLogger from this manager for a specific Bundle. Implementation delegates to PaxLoggingService or to fallback logger provider. fqcn parameter will be part of the returned PaxLogger to determine the location where logging method is invoked (by analyzing stack/class trace). This method passes a Bundle to associate with returned PaxLogger. Note that for java.util.logging, the logger is not directly obtained by "client" code, but rather in pax-logging specific Handler.
        Specified by:
        getLogger in interface PaxLoggingManager
        Parameters:
        bundle - Bundle associated with returned PaxLogger
        category - just name of the logger
        fqcn - fully qualified name for pax-logging-specific factory-like class to make it easy to mark where (in the stack trace) user code calls logging code. It doesn't always make sense - mainly in dynamic scenarios where logging is invoked via LogService and not through concrete logger object
        Returns:
      • getBundle

        public org.osgi.framework.Bundle getBundle()
        Description copied from interface: PaxLoggingManager
        Returns Bundle associated with this manager. Normally it's pax-logging-api bundle.
        Specified by:
        getBundle in interface PaxLoggingManager
        Returns: