Package org.osgi.service.log.admin
Interface LoggerAdmin
-
@ProviderType public interface LoggerAdminLoggerAdmin service for configuring loggers.Each bundle may have its own named
LoggerContextbased upon its bundle symbolic name, bundle version, and bundle location. There is also a root Logger Context from which each named Logger Context inherits. The root Logger Context has no name.When a bundle logs, the logger implementation must locate the Logger Context for the bundle to determine the
effective log levelof the logger name. The best matching name for the Logger Context is the longest name, which has a non-empty Logger Context, according to this syntax:name ::= symbolic-name ( '|' version ( '|' location )? )?
The version must be formatted canonically, that is, according to thetoString()method of theVersionclass. So the Logger Context for a bundle is searched for using the following names in the given order:<symbolic-name>|<version>|<location> <symbolic-name>|<version> <symbolic-name>
The search stops at the firstnon-emptyLogger Context. If no non-empty Logger Context is found using the above search order, the Logger Context with the symbolic name of the bundle must be used for the bundle.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLOG_SERVICE_IDLogger Admin service property to associate the Logger Admin service with aLoggerFactoryservice.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LoggerContextgetLoggerContext(java.lang.String name)Get the Logger Context for the specified name.
-
-
-
Field Detail
-
LOG_SERVICE_ID
static final java.lang.String LOG_SERVICE_ID
Logger Admin service property to associate the Logger Admin service with aLoggerFactoryservice.This service property is set to the
service.idfor theLoggerFactoryservice administered by this Logger Admin.The value of this service property must be of type
Long.- See Also:
- Constant Field Values
-
-
Method Detail
-
getLoggerContext
LoggerContext getLoggerContext(java.lang.String name)
Get the Logger Context for the specified name.- Parameters:
name- The name of the Logger Context. Can benullto specify the root Logger Context.- Returns:
- The Logger Context for the specified name. The returned Logger
Context may be
empty.
-
-