Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I use logging in OSGi?

logging OSGi
0
Posted

How can I use logging in OSGi?

0

OSGi platforms do not change the way libraries work, it just enforces tighter classloading. Thus, you can, in most of the cases, use the same logging strategy used in non-OSGi environments. Spring (and Spring DM) use internally the commons-logging API which acts as an “ultra-thin bridge between different logging implementations”. In OSGi, just like in a non-OSGi environment, Spring and Spring DM delegate all logging (including initialisation) to the actual commons-logging API implementation. Out of the box, SLF4J library is provided, which shares the same purpose as commons-logging but without the class loading discovery mechanism (that causes loading issues), using static wiring (see the SLF4J site for more info). To use slf4j, make sure you use: slf4j-api-XXX.jar, jcl104-overslf4j-XXX.jar and slf4j-log4j-XXX.jar (where XXX stands for the slf4j version). The last jar provides the static wiring between slf4j and log4j – if another implementation is desired (such as jdk14), then a diffe

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123