Pinned topic Logging in OSGi
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Just wondering what you guys using for logging in the OSGi applications. The information is scarce on this subject.
Updated on 2011-09-09T18:37:43Z at 2011-09-09T18:37:43Z by izhd
Re: Logging in OSGi2011-09-09T16:51:13ZThis is the accepted answer. This is the accepted answer.Well, I find it particularly frustrating that there's no good documentation of how to set up logging in OSGi application in WAS. I've spent a lot of time trying to find good solution. I think it would be tremendous help if IBM team could come up with article/guideline how to do that.
Essentially I've explored 2 options:
1) PAX logging - was easy to setup, but not clear how to configure it since feature pack doesn't provide Config service.
2) slf4j - I followed example in "Getting Started with the Feature Pack for OSGi Applications and JPA 2.0" book. It gave good explanation, but not for using log4j as implementation. I had to look for the configuration solution and found it (fragment bundle with log4j.properties). Now I got into troubles because it looks like there some problems with initialization of loggers
SLF4J: The following loggers will not work because they were created
SLF4J: during the default configuration phase of the underlying logging system.
SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
So randomly some of the loggers are not created when application starts.. And here I stuck again.
Re: Logging in OSGi2011-09-09T18:37:43ZThis is the accepted answer. This is the accepted answer.
- izhd 120000GXD1
I think the similar bundles should be a part of WAS OSGi feature pack