[ https://issues.apache.org/jira/browse/FELIX-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549372 ]
Felix Meschberger commented on FELIX-428: ----------------------------------------- My patch makes the framework logger extensible, such that the new protected doLog() is only called if no LogService is available. All logging from the public log() method go through the private _log() method, which dispatches to the LogService or the doLog() method depending on whether the LogService is available or not. An extension of the framework Logger class is intended to overwrite the new protected doLog() method to handle log messages as long as the LogService is not available, for example like this: public class MyLogger extends org.apache.felix.framework.Logger { // constructors ommitted protected doLog(int level, String message, Throwable throwable) { callMyLogger(level, message, throwable); } } The Felix framework may then be instantiated as follows: (1) new Felix(props, activators) --- Use default Logger instance (2) new Felix(props, null, activators) --- Use default Logger instance (3) new Felix(props, new o.a.f.framework.Logger(), activators) --- Use framework Logger (4) new Felix(props, new MyLogger(), activators) --- Use Logger extension > Support Application supplied Logger instance for the framework > -------------------------------------------------------------- > > Key: FELIX-428 > URL: https://issues.apache.org/jira/browse/FELIX-428 > Project: Felix > Issue Type: Improvement > Components: Framework > Reporter: Felix Meschberger > Attachments: FELIX-428.patch > > > In certain environments where the Felix framework is embeded, the environment > may provide a logging facility which should be used by the framework as long > as no OSGi LogService is available. > For example, in Sling we have a web application based launcher, which embeds > the Felix framework in a web application. In this case, it would be usefull > to have the log messages being directed to the ServletContext.log methods > until the LogService is set up. > Will attach a patch to implement this feature. > WDYT ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.