Results 1 to 2 of 2

Thread: Logging in War

  1. #1
    Join Date
    Feb 2010
    Posts
    8

    Default Logging in War

    I am trying to log in a war application within OSGI framework. I have been able to log in the web-app by manually configuring using JoranConfigurator using a separate logging.xml. However, I want to use the existing the logback framework built within the dm-server with the serviceability.xml. When I try the built-in approach and attempt to instantiate a slf4j logger using the following code

    org.slf4j.Logger slf4j = LoggerFactory.getLogger(getClass().getName());

    I get an error/exception upon deployment saying class not found. How can I leverage the existing the framework with it's logging config file and still be able to log using the slf4j? I have read The user-guide/programmer's on DM-SERVER and it has not helped.

    thanks

    Sonam
    Last edited by sonam; Mar 1st, 2010 at 12:34 PM.

  2. #2
    Join Date
    Dec 2005
    Location
    Philadelphia, PA, USA
    Posts
    228

    Default

    You will need to add Import-Package headers to you MANIFEST.MF

    Code:
    Import-Package: org.slf4j
    Make sure that logback, and slf4j are not included in WEB-INF/lib. Those libraries will be provisioned from dm-server for you.

    Do you deploy just a plain war or do you prepare your manifest.mf in any way for OSGi?
    Thanks
    Dmitry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •