Class ExtLogManager

java.lang.Object
org.osgi.util.tracker.ServiceTracker<Object,Object>
All Implemented Interfaces:
EventListener, org.osgi.framework.BundleListener, org.osgi.util.tracker.ServiceTrackerCustomizer<Object,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 Details

    • SCR_LOGGER_NAME

      public static String SCR_LOGGER_NAME
    • SCR_LOGGER_PREFIX

      public static String SCR_LOGGER_PREFIX
    • bundle

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

    • ExtLogManager

      ExtLogManager(org.osgi.framework.BundleContext context, LogConfiguration config)
  • Method Details

    • 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 invalid input: '&' the Logger.ROOT_LOGGER_NAME
      Overrides:
      scr in class ScrLogManager
      Returns:
      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 invalid input: '&' 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, String implementationClass, 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 invalid input: '&' the implementation class as logger name.
      Overrides:
      component in class ScrLogManager
      Parameters:
      bundle - the target bundle
      Returns:
      a logger suitable to log bundle entries
    • componentPrefix

      String componentPrefix(ScrLogManager.ScrLoggerFacade slf, long id)
      Overrides:
      componentPrefix in class ScrLogManager