RE: Logging OSGi internals

Jan Tošovský, modified 5 Years ago. Liferay Master Posts: 576 Join Date: 7/22/10 Recent Posts
In LR Server Administration there are 11 OSGi related categories in the Log Levels tab. Even all are set to the ALL level, when redeploying the module I can only see two lines STOPPED xxx and STARTED xxx in the server log.
  • aQute.bnd.osgi     
  • com.liferay.osgi.felix.file.install.configuration.cleaner.internal     
  • com.liferay.osgi.log.service.extender.internal.OSGiLogServiceExtenderBundleActivator     
  • com.liferay.portal.osgi.debug.declarative.service.internal.UnsatisfiedComponentScanner     
  • com.liferay.portal.osgi.debug.internal.osgi.commands.SystemCheckOSGiCommands     
  • com.liferay.portal.osgi.debug.spring.extender.internal.UnavailableComponentScanner     
  • com.liferay.portal.osgi.web.wab.generator.internal.WabGenerator     
  • com.liferay.portal.osgi.web.wab.generator.internal.processor.WabProcessor     
  • osgi.logging     
  • osgi.logging.org_apache_felix_fileinstall     
  • osgi.logging.org_eclipse_osgi
I believe there are lots of details what is happening under the hood.
Deploying one my module breaks functionality in other modules and I believe there could be some details why.
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
There is a lot happening, sure, but none of it is logging.

Wrapping code with if (_log.isDebugEnabled()) seems like a great way to control whether a log message is generated, but even this adds overhead. In single instances, the overhead is negligible, but if you have a server doing this check frequently while trying to serve thousands of concurrent requests, the overhead is measurable and significant.

For that reason, there is little if any logging decorating the Liferay code, typically you'll only find it at key points where errors can originate outside of Liferay's control and due to customization or configuration.

So the TL;DR version, the best way to understand what is going on under the hood is by a deep code dive or live debugging.