Class ExtLogManager
java.lang.Object
org.osgi.util.tracker.ServiceTracker<Object,Object>
org.apache.felix.scr.impl.logger.LogManager
org.apache.felix.scr.impl.logger.ScrLogManager
org.apache.felix.scr.impl.logger.ExtLogManager
- All Implemented Interfaces:
EventListener, org.osgi.framework.BundleListener, org.osgi.util.tracker.ServiceTrackerCustomizer<Object,Object>
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
-
Nested Class Summary
Nested classes/interfaces inherited from class ScrLogManager
ScrLogManager.ScrLoggerFacadeNested classes/interfaces inherited from class LogManager
LogManager.Lock, LogManager.LogDomain, LogManager.LoggerFacade -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.osgi.framework.Bundlestatic Stringstatic StringFields inherited from class LogManager
closed, lock, scrContextFields inherited from class org.osgi.util.tracker.ServiceTracker
context, filter -
Constructor Summary
ConstructorsConstructorDescriptionExtLogManager(org.osgi.framework.BundleContext context, LogConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionbundle(org.osgi.framework.Bundle bundle) This logger is used for the logging on a per bundle basis.This logger is used for the logging on a per bundle basis.(package private) StringcomponentPrefix(ScrLogManager.ScrLoggerFacade slf, long id) scr()This logger is used for the main code of SCR.Methods inherited from class ScrLogManager
createLoggerFacade, format, getBundleIdentifier, getLogLevelMethods inherited from class LogManager
addingService, bundleChanged, close, getLogger, init, removedServiceMethods inherited from class org.osgi.util.tracker.ServiceTracker
getService, getService, getServiceReference, getServiceReferences, getServices, getServices, getTracked, getTrackingCount, isEmpty, modifiedService, open, open, remove, size, waitForService
-
Field Details
-
SCR_LOGGER_NAME
-
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
Description copied from class:ScrLogManagerThis logger is used for the main code of SCR. This will use the SCR bundle invalid input: '&' theLogger.ROOT_LOGGER_NAME- Overrides:
scrin classScrLogManager- Returns:
- scr logger.
-
bundle
Description copied from class:ScrLogManagerThis logger is used for the logging on a per bundle basis. This will use the target bundle invalid input: '&' theLogger.ROOT_LOGGER_NAME- Overrides:
bundlein classScrLogManager- 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:ScrLogManagerThis 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:
componentin classScrLogManager- Parameters:
bundle- the target bundle- Returns:
- a logger suitable to log bundle entries
-
componentPrefix
- Overrides:
componentPrefixin classScrLogManager
-