Package org.apache.felix.scr.impl.logger
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 org.apache.felix.scr.impl.logger.ScrLogManager
ScrLogManager.ScrLoggerFacade
Nested classes/interfaces inherited from class org.apache.felix.scr.impl.logger.LogManager
LogManager.Lock, LogManager.LogDomain, LogManager.LoggerFacade
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.osgi.framework.Bundle
static String
static String
Fields inherited from class org.apache.felix.scr.impl.logger.LogManager
closed, lock, scrContext
Fields 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) String
componentPrefix
(ScrLogManager.ScrLoggerFacade slf, long id) scr()
This logger is used for the main code of SCR.Methods inherited from class org.apache.felix.scr.impl.logger.ScrLogManager
createLoggerFacade, format, getBundleIdentifier, getLogLevel
Methods inherited from class org.apache.felix.scr.impl.logger.LogManager
addingService, bundleChanged, close, getLogger, init, removedService
Methods 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:ScrLogManager
This logger is used for the main code of SCR. This will use the SCR bundle invalid input: '&' theLogger.ROOT_LOGGER_NAME
- Overrides:
scr
in classScrLogManager
- Returns:
- scr logger.
-
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: '&' theLogger.ROOT_LOGGER_NAME
- Overrides:
bundle
in 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: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 classScrLogManager
- Parameters:
bundle
- the target bundle- Returns:
- a logger suitable to log bundle entries
-
componentPrefix
- Overrides:
componentPrefix
in classScrLogManager
-