Topic
  • 3 replies
  • Latest Post - ‏2011-09-09T18:37:43Z by izhd
izhd
izhd
17 Posts

Pinned topic Logging in OSGi

‏2011-06-16T22:45:35Z |
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
  • MattMadhavan
    MattMadhavan
    65 Posts

    Re: Logging in OSGi

    ‏2011-06-21T20:50:41Z  
    HI izhd,
    Please refer to PAX-Logging. Thats what I have been using for my projects!

    Thanks
    Matt
  • izhd
    izhd
    17 Posts

    Re: Logging in OSGi

    ‏2011-09-09T16:51:13Z  
    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
    SLF4J: com.wellsfargo.imaging.icms.layout.api.impl.LayoutProviderImpl

    So randomly some of the loggers are not created when application starts.. And here I stuck again.

    Igor
  • izhd
    izhd
    17 Posts

    Re: Logging in OSGi

    ‏2011-09-09T18:37:43Z  
    • izhd
    • ‏2011-09-09T16:51:13Z
    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
    SLF4J: com.wellsfargo.imaging.icms.layout.api.impl.LayoutProviderImpl

    So randomly some of the loggers are not created when application starts.. And here I stuck again.

    Igor
    Problem with slf4j was solved by using log4j and slf4j bundles from Spring DM
    I think the similar bundles should be a part of WAS OSGi feature pack