[ 
https://issues.apache.org/jira/browse/FELIX-4306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Mathers updated FELIX-4306:
-----------------------------------

    Description: 
in org.apache.felix.framework.Logger.setSystemBundleContext()

        // TODO: Find a way to log to a log service inside the framework.
        // The issue is that we log messages while holding framework
        // internal locks -- hence, when a log service calls back into 
        // the framework (e.g., by loading a class) we might deadlock. 
        // One instance of this problem is tracked in FELIX-536.
        // For now we just disable logging to log services inside the
        // framework. 

        // m_context = context;
        // startListeningForLogService();

Is there any progress on this I'm wondering?

This would be very useful to me, since I've setup a LogListener implementation 
(which is added to the LogReaderService via logReaderService.addLogListener)

not my exact code (I use a ServiceTracker/ServiceTrackerCustomizer 
combination), but copied from
http://felix.apache.org/site/apache-felix-log.html

ServiceReference ref = 
context.getServiceReference(LogReaderService.class.getName());
if (ref != null)
{
    LogReaderService reader = (LogReaderService) context.getService(ref);
    reader.addLogListener(new LogListenerImpl());
}

... This would allow me to capture internal framework log entries, such as 
DEBUG-level bundle wiring messages, etc.

I realize that I could pass a new Logger to a new Felix instance (in the fwk 
config map), but this breaks the OSGi platform independence of my codebase 
(think equinox, knopflerfish)

  was:
in org.apache.felix.framework.Logger.setSystemBundleContext()

        // TODO: Find a way to log to a log service inside the framework.
        // The issue is that we log messages while holding framework
        // internal locks -- hence, when a log service calls back into 
        // the framework (e.g., by loading a class) we might deadlock. 
        // One instance of this problem is tracked in FELIX-536.
        // For now we just disable logging to log services inside the
        // framework. 

        // m_context = context;
        // startListeningForLogService();

Is there any progress on this I'm wondering?

This would be very useful to me, since I've setup a LogListener implementation 
(which is added to the LogReaderService via logReaderService.addLogListener)

not my exact code (I use a ServiceTracker/ServiceTrackerCustomizer 
combination), but copied from
http://felix.apache.org/site/apache-felix-log.html

ServiceReference ref = 
context.getServiceReference(LogReaderService.class.getName());
if (ref != null)
{
    LogReaderService reader = (LogReaderService) context.getService(ref);
    reader.addLogListener(new LogListenerImpl());
}

... This would allow me to capture internal framework log entries, such as 
DEBUG-level bundle wiring messages, etc.


> org.apache.felix.framework.Logger to use LogService if available?
> -----------------------------------------------------------------
>
>                 Key: FELIX-4306
>                 URL: https://issues.apache.org/jira/browse/FELIX-4306
>             Project: Felix
>          Issue Type: Improvement
>          Components: Log Service
>    Affects Versions: framework-4.2.1
>            Reporter: Michael Mathers
>            Priority: Minor
>
> in org.apache.felix.framework.Logger.setSystemBundleContext()
>         // TODO: Find a way to log to a log service inside the framework.
>         // The issue is that we log messages while holding framework
>         // internal locks -- hence, when a log service calls back into 
>         // the framework (e.g., by loading a class) we might deadlock. 
>         // One instance of this problem is tracked in FELIX-536.
>         // For now we just disable logging to log services inside the
>         // framework. 
>         // m_context = context;
>         // startListeningForLogService();
> Is there any progress on this I'm wondering?
> This would be very useful to me, since I've setup a LogListener 
> implementation (which is added to the LogReaderService via 
> logReaderService.addLogListener)
> not my exact code (I use a ServiceTracker/ServiceTrackerCustomizer 
> combination), but copied from
> http://felix.apache.org/site/apache-felix-log.html
> ServiceReference ref = 
> context.getServiceReference(LogReaderService.class.getName());
> if (ref != null)
> {
>     LogReaderService reader = (LogReaderService) context.getService(ref);
>     reader.addLogListener(new LogListenerImpl());
> }
> ... This would allow me to capture internal framework log entries, such as 
> DEBUG-level bundle wiring messages, etc.
> I realize that I could pass a new Logger to a new Felix instance (in the fwk 
> config map), but this breaks the OSGi platform independence of my codebase 
> (think equinox, knopflerfish)



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to