Hi Sameera,

What are the benefits of having logging function as an OSGI service,  Can't
we simply make logging available in the plain java way across all the
bundles?

Chamil


On Mon, Dec 16, 2013 at 12:02 PM, Sameera Jayasoma <[email protected]> wrote:

> We've implemented the logging functionality in C5 is using Pax logging.
> Logging is enabled when the Pax logging bundle is activated.
>
> But I faced two major issues with Pax logging that we need to fix
> immediately.
>
> 1) Carbon launcher component logs info and debug levels before launching
> the OSGi framework. These log messages never make their way to the
> wso2carbon.log file. Because the Pax bundle only enables the logging
> services once the Pax bundle is activated by the OSGi framework. Therefore
> OSGi framework has to be up and running to get the logging functionality
> working, otherwise we loose all log messages logged before the OSGi
> framework starts. [1]
>
> 2) OSGi bundles face a similar problem. it is related to the bundle
> starting order. There are two sub issues here. (i) If a bundle becomes
> active and start logging before the Pax bundle becomes active, then we
> again loose those log messages. (ii) OSGi frameworks stops each and every
> bundle before deactivating itself. If the Pax bundle is stopped, then
> logging service becomes unavailable. Say a bundle wants to log during the
> server stop and if the Pax bundle is stopped before this bundle, we loose
> all the logs messages. [2]
>
> If we are going ahead with Pax, then we need to solve these problems ASAP.
>
>
> Thanks,
> Sameera.
>
> [1] CARBON-14612 - Logging component does not capture the logs messages
> logged before Carbon launcher starts OSGi 
> framework<https://wso2.org/jira/browse/CARBON-14612>
> [2] CARBON-14613 - Log messages are lost if they ares logged before the
> Pax bundle is started. <https://wso2.org/jira/browse/CARBON-14613>
>
>
>
> On Fri, Nov 29, 2013 at 2:47 PM, Afkham Azeez <[email protected]> wrote:
>
>> I would suggest going with PAX logging,
>>
>> Azeez
>>
>>
>> On Thu, Nov 28, 2013 at 12:37 PM, Kishanthan Thangarajah <
>> [email protected]> wrote:
>>
>>> I'm bringing up this thread to discuss on the logging backend and
>>> logging framework in C5.
>>>
>>>  Our current logging framework uses log4j as the logging backend and
>>> support a set of logging APIs (commons-logging, slf4j, java-logging, log4j
>>> logger). We currently don't support OSGI LogService. But we need to decide
>>> on whether do we need to support this as there were some decision made
>>> earlier not to support?
>>>
>>> This framework is serving well so far, but if we have to support other
>>> logging APIs then we will have to write them.
>>>
>>> *Alternatives*
>>> 1. Log4j2 [1] (logging backend only)
>>> The next generation of log4j. It is still at the beta stage in release.
>>> This looks promising as the numbers of this is way ahead of its predecessor
>>> [2].
>>>
>>> 2. Pax logging [3] (complete framework)
>>> This framework uses a similar concept as ours. It uses log4j as the
>>> backend and support a whole set of logging APIs such as commons-logging
>>> API, log4J-logger API, jdk-logging, avalon-logger API, knopflerfish-log and
>>> tomcat-juli. It also has support for OSGI LogService API.
>>>
>>> So far we found that Pax logging has the support for all required
>>> logging APIs including the support for OSGI LogService.
>>>
>>> Other projects mostly have written their own way to handle different
>>> logging APIs like ours.
>>>
>>> Thoughts and ideas are welcome !
>>>
>>> Thanks,
>>> Kishanthan.
>>> [1] http://logging.apache.org/log4j/2.x/
>>>  [2]
>>> http://www.javacodegeeks.com/2013/07/log4j-2-performance-close-to-insane.html
>>> [3] https://ops4j1.jira.com/wiki/display/paxlogging/Pax+Logging
>>>
>>> --
>>> *Kishanthan Thangarajah*
>>> Senior Software Engineer,
>>> Platform Technologies Team,
>>> WSO2, Inc.
>>> lean.enterprise.middleware
>>>
>>> Mobile - +94773426635
>>> Blog - *http://kishanthan.wordpress.com
>>> <http://kishanthan.wordpress.com>*
>>> Twitter - *http://twitter.com/kishanthan
>>> <http://twitter.com/kishanthan>*
>>>
>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * <http://www.apache.org/>*
>> *email: **[email protected]* <[email protected]>
>> * cell: +94 77 3320919 <%2B94%2077%203320919> blog: *
>> *http://blog.afkham.org* <http://blog.afkham.org>
>> *twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>> * linked-in: **http://lk.linkedin.com/in/afkhamazeez
>> <http://lk.linkedin.com/in/afkhamazeez>*
>>
>> *Lean . Enterprise . Middleware*
>>
>
>
>
> --
> Sameera Jayasoma,
> Architect,
>
> WSO2, Inc. (http://wso2.com)
> email: [email protected]
> blog: http://sameera.adahas.org
> twitter: https://twitter.com/sameerajayasoma
> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
> Mobile: 0094776364456
>
>
> Lean . Enterprise . Middleware
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
K.D. Chamil Jeewantha
Associate Technical Lead
WSO2, Inc.;  http://wso2.com
Mobile: +94716813892
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to