Package org.apache.felix.scr.impl.logger
Class ExtLogManager
- java.lang.Object
-
- org.osgi.util.tracker.ServiceTracker<java.lang.Object,java.lang.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:
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
-
-
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
Fields Modifier and Type Field Description private org.osgi.framework.Bundle
bundle
static java.lang.String
SCR_LOGGER_NAME
static java.lang.String
SCR_LOGGER_PREFIX
-
Fields inherited from class org.apache.felix.scr.impl.logger.LogManager
closed, lock, scrContext
-
-
Constructor Summary
Constructors Constructor Description ExtLogManager(org.osgi.framework.BundleContext context, ScrConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BundleLogger
bundle(org.osgi.framework.Bundle bundle)
This logger is used for the logging on a per bundle basis.ComponentLogger
component(org.osgi.framework.Bundle bundle, java.lang.String implementationClass, java.lang.String componentName)
This logger is used for the logging on a per bundle basis.(package private) java.lang.String
componentPrefix(ScrLogManager.ScrLoggerFacade slf, long id)
ScrLogger
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, scr
-
Methods inherited from class org.apache.felix.scr.impl.logger.LogManager
addingService, bundleChanged, close, getLogger, removedService
-
-
-
-
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 & theLogger.ROOT_LOGGER_NAME
- Overrides:
scr
in classScrLogManager
- 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 & 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, 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 classScrLogManager
- Parameters:
bundle
- the target bundle- Returns:
- a logger suitable to log bundle entries
-
componentPrefix
java.lang.String componentPrefix(ScrLogManager.ScrLoggerFacade slf, long id)
- Overrides:
componentPrefix
in classScrLogManager
-
-