Results 1 to 7 of 7

Thread: Logging problem

  1. #1

    Default Logging problem

    Hi all,

    Am new to Spring. I downloaded spring recently and tried to develop a web application using webapp-minimal package. Everything was fine except loggng. Am unable to enable logging into my web application. I tried deploying web application into Weblogic. But my appserver is not trying to initialize my logging i.e. not trying to write to my log file.

    Can some highlight me the problem. Thanx in advance for any help.

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    there have been some discussions about this in the past at least regarding WebSphere - not sure if you already done this but please do a search on the forum.
    Spring uses commons-logging so I guess the problem is getting Weblogic to initialize commons-logging (and the underlying logging system - usually log4j).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3

    Default

    Weblogic has its own logging mechanism. I have done the steps exactly as mentioned in Spring MVC Step by Step document.

    1. Created a log4j.properties and put it in /WEB-INF/classes folder. Used File appender.
    2. Put the commons-logging.jar in the /WEB-INF/lib folder.
    3. Then used the log factory class to initialize in my program.
    4. Deployed to Weblogic. But didnt see the initialization of log4j in Weblogic Startup.

    The problem is didnt create any log file in the directory i specified. Can someone help?

  4. #4
    Join Date
    Sep 2004
    Posts
    1,086

    Default

    Quote Originally Posted by SpringDeveloper
    Weblogic has its own logging mechanism. I have done the steps exactly as mentioned in Spring MVC Step by Step document.

    1. Created a log4j.properties and put it in /WEB-INF/classes folder. Used File appender.
    2. Put the commons-logging.jar in the /WEB-INF/lib folder.
    3. Then used the log factory class to initialize in my program.
    4. Deployed to Weblogic. But didnt see the initialization of log4j in Weblogic Startup.

    The problem is didnt create any log file in the directory i specified. Can someone help?
    Where did you put log4j.jar?

  5. #5

    Default

    I put both my commons-logging and log4j in the /WEB-INF/lib folder.

  6. #6
    Join Date
    May 2005
    Location
    Radebeul, Saxony
    Posts
    29

    Default

    Try to start your server with:
    Code:
    -Dlog4j.debug
    MfG Mirko

  7. #7
    Join Date
    Sep 2004
    Posts
    602

    Default

    Quote Originally Posted by Costin Leau
    there have been some discussions about this in the past at least regarding WebSphere - not sure if you already done this but please do a search on the forum.
    Spring uses commons-logging so I guess the problem is getting Weblogic to initialize commons-logging (and the underlying logging system - usually log4j).
    A quick Websphere recap - IBM use a jar called ws-commons.jar that redirects all commons logging to websphere logs. Just bin this jar file and if you are using log4j just make sure log4j.properties in the app servers classpath. Of course I wouldn't recommend this in a production environment !

Posting Permissions

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