In OSGi (as in any environment) you try to stay away from static assistants as much as possible, therefore solving a static log method is not the best way to go here. When you start the OSGi environment, you will want to use LogService as the central, connecting, and serving channel for all your protocols. Two cases are considered.
Legacy and library code
If the code you use requires a logging function but does not know OSGi, you can build (or find) bridges in LogService .
Code under your control
Assuming all the code under your control should be serving, it should use LogService directly. For most components, this is easy, but in some cases additional consideration is required.
A private consideration is lengthy operations that are not related to OSGi: if you give a link to a service, for example, a workflow that can work for a very long time, you ask for problems, and not just for logging.
source share