public class PaxLoggingServiceImpl extends Object implements org.ops4j.pax.logging.PaxLoggingService, org.osgi.framework.ServiceFactory<Object>
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
This is an important performance optimization, as discussed in the Logback docs| Modifier and Type | Field and Description |
|---|---|
static String |
LOGGER_CONTEXT_BUNDLECONTEXT_KEY |
| Constructor and Description |
|---|
PaxLoggingServiceImpl(org.osgi.framework.BundleContext bundleContext,
org.ops4j.pax.logging.spi.support.LogReaderServiceImpl logReader,
org.ops4j.pax.logging.EventAdminPoster eventAdmin,
org.ops4j.pax.logging.spi.support.ConfigurationNotifier configNotifier,
org.ops4j.pax.logging.PaxLogger logLog) |
| Modifier and Type | Method and Description |
|---|---|
<L extends org.osgi.service.log.Logger> |
getLogger(org.osgi.framework.Bundle bundle,
String name,
Class<L> loggerType) |
org.ops4j.pax.logging.PaxLogger |
getLogger(org.osgi.framework.Bundle bundle,
String category,
String fqcn) |
org.osgi.service.log.Logger |
getLogger(Class<?> clazz) |
<L extends org.osgi.service.log.Logger> |
getLogger(Class<?> clazz,
Class<L> loggerType) |
org.osgi.service.log.Logger |
getLogger(String name) |
<L extends org.osgi.service.log.Logger> |
getLogger(String name,
Class<L> loggerType) |
org.osgi.service.log.LogLevel |
getLogLevel() |
org.ops4j.pax.logging.PaxContext |
getPaxContext() |
Object |
getService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceRegistration registration)
Use local class to delegate calls to underlying instance while keeping bundle reference.
|
void |
log(int level,
String message) |
void |
log(int level,
String message,
Throwable exception) |
void |
log(org.osgi.framework.ServiceReference sr,
int level,
String message) |
void |
log(org.osgi.framework.ServiceReference sr,
int level,
String message,
Throwable exception) |
void |
setDefaultConfiguration(Dictionary<String,String> config)
When there's system/context property specified using
PaxLoggingConstants.LOGGING_CFG_PROPERTY_FILE,
and ConfigurationAdmin is available, Pax Logging may first get null configuration. |
void |
shutdown()
Shut down the Pax Logging service.
|
void |
ungetService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceRegistration registration,
Object service) |
void |
updated(Dictionary<String,?> configuration)
ManagedService-like method but not requiring Configuration Admin
|
public static final String LOGGER_CONTEXT_BUNDLECONTEXT_KEY
public PaxLoggingServiceImpl(org.osgi.framework.BundleContext bundleContext,
org.ops4j.pax.logging.spi.support.LogReaderServiceImpl logReader,
org.ops4j.pax.logging.EventAdminPoster eventAdmin,
org.ops4j.pax.logging.spi.support.ConfigurationNotifier configNotifier,
org.ops4j.pax.logging.PaxLogger logLog)
public void shutdown()
LoggerContext.public org.ops4j.pax.logging.PaxLogger getLogger(org.osgi.framework.Bundle bundle,
String category,
String fqcn)
getLogger in interface org.ops4j.pax.logging.PaxLoggingServicepublic org.osgi.service.log.LogLevel getLogLevel()
getLogLevel in interface org.ops4j.pax.logging.PaxLoggingServicepublic void log(int level,
String message)
log in interface org.osgi.service.log.LogServicepublic void log(int level,
String message,
Throwable exception)
log in interface org.osgi.service.log.LogServicepublic void log(org.osgi.framework.ServiceReference sr,
int level,
String message)
log in interface org.osgi.service.log.LogServicepublic void log(org.osgi.framework.ServiceReference sr,
int level,
String message,
Throwable exception)
log in interface org.osgi.service.log.LogServicepublic org.ops4j.pax.logging.PaxContext getPaxContext()
getPaxContext in interface org.ops4j.pax.logging.PaxLoggingServicepublic org.osgi.service.log.Logger getLogger(String name)
getLogger in interface org.osgi.service.log.LoggerFactorypublic org.osgi.service.log.Logger getLogger(Class<?> clazz)
getLogger in interface org.osgi.service.log.LoggerFactorypublic <L extends org.osgi.service.log.Logger> L getLogger(String name, Class<L> loggerType)
getLogger in interface org.osgi.service.log.LoggerFactorypublic <L extends org.osgi.service.log.Logger> L getLogger(Class<?> clazz, Class<L> loggerType)
getLogger in interface org.osgi.service.log.LoggerFactorypublic <L extends org.osgi.service.log.Logger> L getLogger(org.osgi.framework.Bundle bundle,
String name,
Class<L> loggerType)
getLogger in interface org.osgi.service.log.LoggerFactorypublic void setDefaultConfiguration(Dictionary<String,String> config)
PaxLoggingConstants.LOGGING_CFG_PROPERTY_FILE,
and ConfigurationAdmin is available, Pax Logging may first get null configuration. When "default configuration"
is set before that, we'll use it instead of empty configuration.config - public void updated(Dictionary<String,?> configuration)
configuration - public Object getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration)
ServiceFactory) except the
reference to client bundle.getService in interface org.osgi.framework.ServiceFactory<Object>Copyright © 2006–2022 OPS4J - Open Participation Software for Java. All rights reserved.