Class ExtLogManager

  • All Implemented Interfaces:
    java.util.EventListener, org.osgi.framework.BundleListener, org.osgi.util.tracker.ServiceTrackerCustomizer<java.lang.Object,​java.lang.Object>

    class ExtLogManager
    extends ScrLogManager
    Implements an extension to the SCR log manager that uses logger names to create a hierarchy of loggers. All messages will be logged via the SCR logger's bundle unlike the classic scr log manager that used the bundle's logger.
    • An ScrLogger will log with the name
    • A BundleLogger will log with the name + the bundle symbolic name
    • A ComponentLogger will log with the name + the bundle symbolic name + "." + component name
    • Field Detail

      • SCR_LOGGER_NAME

        public static java.lang.String SCR_LOGGER_NAME
      • SCR_LOGGER_PREFIX

        public static java.lang.String SCR_LOGGER_PREFIX
      • bundle

        private final org.osgi.framework.Bundle bundle
    • Constructor Detail

      • ExtLogManager

        ExtLogManager​(org.osgi.framework.BundleContext context,
                      ScrConfiguration config)
    • Method Detail

      • scr

        public ScrLogger scr()
        Description copied from class: ScrLogManager
        This logger is used for the main code of SCR. This will use the SCR bundle & the Logger.ROOT_LOGGER_NAME
        Overrides:
        scr in class ScrLogManager
        Returns:
        an Scr Logger.
      • bundle

        public BundleLogger bundle​(org.osgi.framework.Bundle bundle)
        Description copied from class: ScrLogManager
        This logger is used for the logging on a per bundle basis. This will use the target bundle & the Logger.ROOT_LOGGER_NAME
        Overrides:
        bundle in class ScrLogManager
        Parameters:
        bundle - the target bundle
        Returns:
        a logger suitable to log bundle entries
      • component

        public ComponentLogger component​(org.osgi.framework.Bundle bundle,
                                         java.lang.String implementationClass,
                                         java.lang.String componentName)
        Description copied from class: ScrLogManager
        This logger is used for the logging on a per bundle basis. This will use the target bundle & the implementation class as logger name.
        Overrides:
        component in class ScrLogManager
        Parameters:
        bundle - the target bundle
        Returns:
        a logger suitable to log bundle entries